diff --git a/packages/string-templates/src/helpers/list.js b/packages/string-templates/src/helpers/list.js index b59efb1ef3..6d5241cdd8 100644 --- a/packages/string-templates/src/helpers/list.js +++ b/packages/string-templates/src/helpers/list.js @@ -21,6 +21,17 @@ module.exports.getHelperList = () => { for (let key of Object.keys(externalHandlebars.addedHelpers)) { helpers[key] = externalHandlebars.addedHelpers[key] } + + helpers = adjustJsHelpers(helpers) Object.freeze(helpers) return helpers } + +function adjustJsHelpers(helpers) { + const result = { ...helpers } + + result.avg = function (...params) { + return helpers.avg(...params, {}) + } + return result +} diff --git a/packages/string-templates/test/manifest.spec.js b/packages/string-templates/test/manifest.spec.js index c48bc9c9fc..af0b6630a4 100644 --- a/packages/string-templates/test/manifest.spec.js +++ b/packages/string-templates/test/manifest.spec.js @@ -121,7 +121,6 @@ describe("manifest", () => { }) let convertedJs = convertToJS(hbs) - convertedJs = convertedJs.replace(/\n/g, "\n") let result = processJS(convertedJs, context) result = result.replace(/ /g, " ")