Skip to content

Commit 55b4cba

Browse files
committed
fix: avoid generating invalid json objects using fastcheck
1 parent acaf8ac commit 55b4cba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ const messagesToReadableStream = (messages: Array<JSONRPCMessage>) => {
8383
*/
8484
const safeJsonValueArb = fc
8585
.json()
86-
.map((value) => JSON.parse(value.replace('__proto__', 'proto')) as JSONValue)
86+
.map((value) => JSON.parse(value.replaceAll('__proto__', 'proto')) as JSONValue)
8787
.noShrink();
8888

8989
const safeJsonObjectArb = fc.dictionary(
90-
fc.string().map((s) => s.replace('__proto__', 'proto')),
90+
fc.string().map((s) => s.replaceAll('__proto__', 'proto')),
9191
safeJsonValueArb,
9292
) as fc.Arbitrary<JSONObject>;
9393

0 commit comments

Comments
 (0)