From d24ea36c64181adf73c1053aa4e5932b13dbbafa Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 22 Feb 2024 00:26:18 +0100 Subject: [PATCH] Fixes --- packages/string-templates/src/index.ts | 4 ++-- packages/string-templates/test/escapes.spec.ts | 2 +- packages/string-templates/test/hbsToJs.spec.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/string-templates/src/index.ts b/packages/string-templates/src/index.ts index 2549d0b34c..b5d5590050 100644 --- a/packages/string-templates/src/index.ts +++ b/packages/string-templates/src/index.ts @@ -105,7 +105,7 @@ export async function processObject(object, context, opts?) { export async function processString( string: string, context: object, - opts?: { noHelpers: boolean } + opts?: { noHelpers?: boolean; escapeNewlines?: boolean } ) { // TODO: carry out any async calls before carrying out async call return processStringSync(string, context, opts) @@ -367,7 +367,7 @@ export function doesContainString(template, string) { export function convertToJS(hbs) { const blocks = findHBSBlocks(hbs) let js = "return `", - prevBlock = null + prevBlock: string | null = null const variables = {} if (blocks.length === 0) { js += hbs diff --git a/packages/string-templates/test/escapes.spec.ts b/packages/string-templates/test/escapes.spec.ts index caa2f7d0c1..ffc72a6b92 100644 --- a/packages/string-templates/test/escapes.spec.ts +++ b/packages/string-templates/test/escapes.spec.ts @@ -1,4 +1,4 @@ -const { processString } = require("../src/index.js") +import { processString } from "../src/index" describe("Handling context properties with spaces in their name", () => { it("should allow through literal specifiers", async () => { diff --git a/packages/string-templates/test/hbsToJs.spec.ts b/packages/string-templates/test/hbsToJs.spec.ts index 08d8ff5f67..f8b4c2fca9 100644 --- a/packages/string-templates/test/hbsToJs.spec.ts +++ b/packages/string-templates/test/hbsToJs.spec.ts @@ -1,4 +1,4 @@ -const { convertToJS } = require("../src/index.js") +import { convertToJS } from "../src/index" function checkLines(response, lines) { const toCheck = response.split("\n")