Ensure processObjectSync does not throw.

This commit is contained in:
Sam Rose 2024-10-04 11:13:30 +01:00
parent c2358a6d6d
commit 2e4607edb6
No known key found for this signature in database
1 changed files with 5 additions and 1 deletions

View File

@ -179,7 +179,11 @@ export function processObjectSync(
for (let key of Object.keys(object || {})) { for (let key of Object.keys(object || {})) {
let val = object[key] let val = object[key]
if (typeof val === "string") { if (typeof val === "string") {
try {
object[key] = processStringSync(object[key], context, opts) object[key] = processStringSync(object[key], context, opts)
} catch (error: any) {
object[key] = error.toString()
}
} else if (typeof val === "object") { } else if (typeof val === "object") {
object[key] = processObjectSync(object[key], context, opts) object[key] = processObjectSync(object[key], context, opts)
} }