1
0
Fork 0
mirror of synced 2024-07-04 05:50:57 +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(
string: string,
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
return processStringSync(string, context, opts)

View file

@ -1,4 +1,4 @@
const {
import {
processObject,
processString,
isValid,
@ -8,7 +8,7 @@ const {
doesContainString,
disableEscaping,
findHBSBlocks,
} = require("../src/index")
} from "../src/index"
describe("Test that the string processing works correctly", () => {
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 () => {
let error = null
try {
await processString(null, null)
await processString(null as any, null as any)
} catch (err) {
error = err
}

View file

@ -1,11 +1,7 @@
const vm = require("vm")
import vm from "vm"
const {
processStringSync,
encodeJSBinding,
setJSRunner,
} = require("../src/index")
const { UUID_REGEX } = require("./constants")
import { processStringSync, encodeJSBinding, setJSRunner } from "../src/index"
import { UUID_REGEX } from "./constants"
const processJS = (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", () => {
it("should be able to render the app template", async () => {