Skip to content

Commit

Permalink
Merge pull request #419 from Sluder/sluder/raw-to-string
Browse files Browse the repository at this point in the history
Convert raw to string
  • Loading branch information
KtorZ authored Sep 17, 2024
2 parents 34c1467 + d1430f4 commit 5cdf90c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clients/TypeScript/packages/client/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5cdf90c

Please sign in to comment.