forked from bigcommerce/paper-handlebars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpers.js
80 lines (75 loc) · 1.4 KB
/
helpers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
const helpersList = [
'all',
'any',
'assignVar',
'block',
'cdn',
'compare',
'concat',
'contains',
'decrementVar',
'dynamicComponent',
'encodeHtmlEntities',
'for',
'get',
'getContentImage',
'getContentImageSrcset',
'getFontLoaderConfig',
'getFontsCollection',
'getImage',
'getImageManagerImage',
'getImageManagerImageSrcset',
'getImageSrcset',
'getImageSrcset1x2x',
'getObject',
'getVar',
'helperMissing',
'if',
'incrementVar',
'inject',
'join',
'jsContext',
'json',
'jsonParseSafe',
'lang',
'langJson',
'limit',
'moment',
'money',
'multiConcat',
'nl2br',
'occurrences',
'option',
'or',
'partial',
'pluck',
'pre',
'region',
'replace',
'resourceHints',
'setURLQueryParam',
'snippets',
'stripQuerystring',
'strReplace',
'stylesheet',
'thirdParty',
'toLowerCase',
'truncate',
'unless',
'earlyHint',
];
const deprecatedHelpersList = [
'enumerate',
'equals',
'getShortMonth',
'pick'
];
let helpers = [];
helpersList.forEach(helper => {
helpers = [...helpers, ...require(`./helpers/${helper}.js`)];
})
deprecatedHelpersList.forEach(helper => {
helpers = [...helpers, ...require(`./helpers/deprecated/${helper}.js`)];
})
// Export full list of helpers
module.exports = helpers;