Merge branch 'master' into BUDI-8113/fix-isolated-vm-bundler
This commit is contained in:
commit
9ba8a21f29
|
@ -94,7 +94,7 @@ export async function processObject<T extends Record<string, any>>(
|
||||||
for (const key of Object.keys(object || {})) {
|
for (const key of Object.keys(object || {})) {
|
||||||
if (object[key] != null) {
|
if (object[key] != null) {
|
||||||
const val = object[key]
|
const val = object[key]
|
||||||
let parsedValue
|
let parsedValue = val
|
||||||
if (typeof val === "string") {
|
if (typeof val === "string") {
|
||||||
parsedValue = await processString(object[key], context, opts)
|
parsedValue = await processString(object[key], context, opts)
|
||||||
} else if (typeof val === "object") {
|
} else if (typeof val === "object") {
|
||||||
|
|
|
@ -104,6 +104,26 @@ describe("Test that the object processing works correctly", () => {
|
||||||
}
|
}
|
||||||
expect(error).toBeNull()
|
expect(error).toBeNull()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should be able to handle booleans", async () => {
|
||||||
|
const output = await processObject(
|
||||||
|
{
|
||||||
|
first: true,
|
||||||
|
second: "true",
|
||||||
|
third: "another string",
|
||||||
|
forth: "with {{ template }}",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
template: "value",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
expect(output).toEqual({
|
||||||
|
first: true,
|
||||||
|
second: "true",
|
||||||
|
third: "another string",
|
||||||
|
forth: "with value",
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("check returning objects", () => {
|
describe("check returning objects", () => {
|
||||||
|
|
Loading…
Reference in New Issue