File size: 487 Bytes
8969f81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as HbsModule from 'hbs';

export const hbs = HbsModule.create();

hbs.registerHelper('urlenc', (str) => {
	return encodeURIComponent(str);
});

hbs.registerHelper('stringify', (o) => {
	return JSON.stringify(o);
});

hbs.registerHelper('eq', function(arg1, arg2, options) {
	return (arg1 === arg2) ? options.fn(this) : options.inverse(this);
});

hbs.registerHelper('not', function(arg1, arg2, options) {
	return (arg1 !== arg2) ? options.fn(this) : options.inverse(this);
});