1 | import { IHtmlEngineHelper } from './html-engine-helper.interface';
|
2 | import * as Handlebars from 'handlebars';
|
3 |
|
4 | export class ObjectHelper implements IHtmlEngineHelper {
|
5 | public helperFunc(context: any, text: string) {
|
6 | text = JSON.stringify(text);
|
7 | text = text.replace(/{"/, '{<br> "');
|
8 | text = text.replace(/,"/, ',<br> "');
|
9 | text = text.replace(/}$/, '<br>}');
|
10 | return new Handlebars.SafeString(text);
|
11 | }
|
12 | }
|