diff --git a/lerna.json b/lerna.json index 5a561bec04..57c2148c7d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.22.9", + "version": "2.22.10", "npmClient": "yarn", "packages": [ "packages/*", diff --git a/packages/string-templates/src/index.ts b/packages/string-templates/src/index.ts index 759fe2dc54..1ac91edd28 100644 --- a/packages/string-templates/src/index.ts +++ b/packages/string-templates/src/index.ts @@ -94,7 +94,7 @@ export async function processObject>( for (const key of Object.keys(object || {})) { if (object[key] != null) { const val = object[key] - let parsedValue + let parsedValue = val if (typeof val === "string") { parsedValue = await processString(object[key], context, opts) } else if (typeof val === "object") { diff --git a/packages/string-templates/test/basic.spec.ts b/packages/string-templates/test/basic.spec.ts index ae006f06f9..00058d4ecd 100644 --- a/packages/string-templates/test/basic.spec.ts +++ b/packages/string-templates/test/basic.spec.ts @@ -104,6 +104,26 @@ describe("Test that the object processing works correctly", () => { } 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", () => {