Fixes
This commit is contained in:
parent
38f64aa704
commit
8bbf318f4a
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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 () => {
|
||||||
|
|
Loading…
Reference in New Issue