Skip to content

Commit 6600ad6

Browse files
committed
Added json handlebars helper
1 parent 715ddce commit 6600ad6

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

rollup.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const handlebarsPlugin = () => ({
3838
union: true,
3939
intersection: true,
4040
enumerator: true,
41+
json: true,
4142
},
4243
});
4344
return `export default ${templateSpec};`;

src/utils/registerHandlebarHelpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,8 @@ export function registerHandlebarHelpers(root: { httpClient: HttpClient; useOpti
5151
.join(' | ')
5252
);
5353
});
54+
55+
Handlebars.registerHelper('json', function (this: any, obj: any) {
56+
return JSON.stringify(obj)
57+
})
5458
}

0 commit comments

Comments
 (0)