From d1430f44052afb1be3eecbe6f6da9964bae98d6d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Sep 2024 09:39:21 -0400 Subject: [PATCH] Convert raw to string --- clients/TypeScript/packages/client/src/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/TypeScript/packages/client/src/util.ts b/clients/TypeScript/packages/client/src/util.ts index faa561522..c5dde6cfe 100644 --- a/clients/TypeScript/packages/client/src/util.ts +++ b/clients/TypeScript/packages/client/src/util.ts @@ -102,7 +102,7 @@ export const safeJSON = { return this.sanitize(this.$.parse(raw)) } catch (e) { if (e.name === 'SyntaxError' && typeof e.message === 'string' && e.message.includes('forbidden constructor')) { - const escaped = raw.replace(/"constructor"/g, '"constr"') + const escaped = raw.toString().replace(/"constructor"/g, '"constr"') return this.sanitize(this.$.parse(escaped)) } throw e