1
0
Fork 0
mirror of synced 2024-07-06 15:00:49 +12:00
This commit is contained in:
Adria Navarro 2024-02-22 00:46:22 +01:00
parent 38f64aa704
commit 8bbf318f4a
4 changed files with 8 additions and 12 deletions

View file

@ -108,7 +108,7 @@ export async function processObject(object, context, opts?) {
export async function processString( export async function processString(
string: string, string: string,
context: object, context: object,
opts?: { noHelpers?: boolean; escapeNewlines?: boolean } opts?: { noHelpers?: boolean; escapeNewlines?: boolean; onlyFound?: boolean }
) { ) {
// 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)

View file

@ -1,4 +1,4 @@
const { import {
processObject, processObject,
processString, processString,
isValid, isValid,
@ -8,7 +8,7 @@ const {
doesContainString, doesContainString,
disableEscaping, disableEscaping,
findHBSBlocks, findHBSBlocks,
} = require("../src/index") } from "../src/index"
describe("Test that the string processing works correctly", () => { describe("Test that the string processing works correctly", () => {
it("should process a basic template string", async () => { it("should process a basic template string", async () => {
@ -28,7 +28,7 @@ describe("Test that the string processing works correctly", () => {
it("should fail gracefully when wrong type passed in", async () => { it("should fail gracefully when wrong type passed in", async () => {
let error = null let error = null
try { try {
await processString(null, null) await processString(null as any, null as any)
} catch (err) { } catch (err) {
error = err error = err
} }

View file

@ -1,11 +1,7 @@
const vm = require("vm") import vm from "vm"
const { import { processStringSync, encodeJSBinding, setJSRunner } from "../src/index"
processStringSync, import { UUID_REGEX } from "./constants"
encodeJSBinding,
setJSRunner,
} = require("../src/index")
const { UUID_REGEX } = require("./constants")
const processJS = (js, context?) => { const processJS = (js, context?) => {
return processStringSync(encodeJSBinding(js), context) return processStringSync(encodeJSBinding(js), context)

View file

@ -1,4 +1,4 @@
const { processString } = require("../src/index") import { processString } from "../src/index"
describe("specific test case for whether or not full app template can still be rendered", () => { describe("specific test case for whether or not full app template can still be rendered", () => {
it("should be able to render the app template", async () => { it("should be able to render the app template", async () => {