Fix typings

This commit is contained in:
Adria Navarro 2024-02-22 11:26:22 +01:00
parent c3531ac8ba
commit 566c4e5c17
2 changed files with 4 additions and 3 deletions

View File

@ -113,7 +113,7 @@ export async function processObject(
export async function processString( export async function processString(
string: string, string: string,
context: object, context: object,
opts?: { noHelpers?: boolean; escapeNewlines?: boolean; onlyFound?: boolean } opts?: ProcessOptions
) { ) {
// TODO: carry out any async calls before carrying out async call // TODO: carry out any async calls before carrying out async call
return processStringSync(string, context, opts) return processStringSync(string, context, opts)
@ -156,7 +156,7 @@ export function processObjectSync(
export function processStringSync( export function processStringSync(
string: string, string: string,
context: object, context: object,
opts?: { noHelpers?: boolean; escapeNewlines?: boolean; onlyFound: any } opts?: ProcessOptions
) { ) {
// Take a copy of input in case of error // Take a copy of input in case of error
const input = string const input = string
@ -397,7 +397,7 @@ export function convertToJS(hbs: string) {
prevBlock = block prevBlock = block
const { variable, value } = convertHBSBlock(block, count++) const { variable, value } = convertHBSBlock(block, count++)
variables[variable] = value variables[variable] = value
js += `${stringPart.split()}\${${variable}}` js += `${stringPart.split("")}\${${variable}}`
} }
let varBlock = "" let varBlock = ""
for (let [variable, value] of Object.entries(variables)) { for (let [variable, value] of Object.entries(variables)) {

View File

@ -4,4 +4,5 @@ export interface ProcessOptions {
noHelpers?: boolean noHelpers?: boolean
noFinalise?: boolean noFinalise?: boolean
escapeNewlines?: boolean escapeNewlines?: boolean
onlyFound?: boolean
} }