diff --git a/packages/string-templates/src/index.ts b/packages/string-templates/src/index.ts index 77ff1f8d73..978f8c0556 100644 --- a/packages/string-templates/src/index.ts +++ b/packages/string-templates/src/index.ts @@ -398,7 +398,7 @@ export function convertToJS(hbs: string) { prevBlock = block const { variable, value } = convertHBSBlock(block, count++) variables[variable] = value - js += `${stringPart.split("")}\${${variable}}` + js += `${[stringPart]}\${${variable}}` } let varBlock = "" for (let [variable, value] of Object.entries(variables)) { diff --git a/packages/string-templates/test/javascript.spec.ts b/packages/string-templates/test/javascript.spec.ts index fd961446da..eb12320cd0 100644 --- a/packages/string-templates/test/javascript.spec.ts +++ b/packages/string-templates/test/javascript.spec.ts @@ -3,7 +3,7 @@ import vm from "vm" import { processStringSync, encodeJSBinding, setJSRunner } from "../src/index" import { UUID_REGEX } from "./constants" -const processJS = (js, context?) => { +const processJS = (js, context?): any => { return processStringSync(encodeJSBinding(js), context) }