Fix avg helper
This commit is contained in:
parent
ceb7fc04f4
commit
5a1d73ff2f
|
@ -21,6 +21,17 @@ module.exports.getHelperList = () => {
|
||||||
for (let key of Object.keys(externalHandlebars.addedHelpers)) {
|
for (let key of Object.keys(externalHandlebars.addedHelpers)) {
|
||||||
helpers[key] = externalHandlebars.addedHelpers[key]
|
helpers[key] = externalHandlebars.addedHelpers[key]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
helpers = adjustJsHelpers(helpers)
|
||||||
Object.freeze(helpers)
|
Object.freeze(helpers)
|
||||||
return helpers
|
return helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function adjustJsHelpers(helpers) {
|
||||||
|
const result = { ...helpers }
|
||||||
|
|
||||||
|
result.avg = function (...params) {
|
||||||
|
return helpers.avg(...params, {})
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
|
@ -121,7 +121,6 @@ describe("manifest", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
let convertedJs = convertToJS(hbs)
|
let convertedJs = convertToJS(hbs)
|
||||||
convertedJs = convertedJs.replace(/\n/g, "\n")
|
|
||||||
|
|
||||||
let result = processJS(convertedJs, context)
|
let result = processJS(convertedJs, context)
|
||||||
result = result.replace(/ /g, " ")
|
result = result.replace(/ /g, " ")
|
||||||
|
|
Loading…
Reference in New Issue