Skip to content

Commit

Permalink
Update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
lxsmnsyc committed Sep 10, 2023
1 parent be45256 commit 63a2005
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 65 deletions.
12 changes: 6 additions & 6 deletions packages/seroval/test/__snapshots__/error.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ exports[`Error > serializeAsync > supports Error.prototype.name 1`] = `"Promise.

exports[`Error > serializeAsync > supports other Error classes 1`] = `"Promise.resolve(Object.assign(new ReferenceError(\\"A\\"),{stack:\\"\\"}))"`;

exports[`Error > toJSON > supports Error.prototype.cause 1`] = `"{\\"t\\":{\\"t\\":13,\\"i\\":0,\\"c\\":\\"Error\\",\\"m\\":\\"B\\",\\"d\\":{\\"k\\":[\\"stack\\",\\"cause\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"},{\\"t\\":13,\\"i\\":1,\\"c\\":\\"Error\\",\\"m\\":\\"A\\",\\"d\\":{\\"k\\":[\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":1}}],\\"s\\":2}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`Error > toJSON > supports Error.prototype.cause 1`] = `"{\\"t\\":{\\"t\\":13,\\"i\\":0,\\"c\\":\\"Error\\",\\"m\\":\\"B\\",\\"p\\":{\\"k\\":[\\"stack\\",\\"cause\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"},{\\"t\\":13,\\"i\\":1,\\"c\\":\\"Error\\",\\"m\\":\\"A\\",\\"p\\":{\\"k\\":[\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":1}}],\\"s\\":2}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`Error > toJSON > supports Error.prototype.name 1`] = `"{\\"t\\":{\\"t\\":13,\\"i\\":0,\\"c\\":\\"Error\\",\\"m\\":\\"A\\",\\"d\\":{\\"k\\":[\\"name\\",\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"ExampleError\\"},{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":2}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`Error > toJSON > supports Error.prototype.name 1`] = `"{\\"t\\":{\\"t\\":13,\\"i\\":0,\\"c\\":\\"Error\\",\\"m\\":\\"A\\",\\"p\\":{\\"k\\":[\\"name\\",\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"ExampleError\\"},{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":2}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`Error > toJSON > supports other Error classes 1`] = `"{\\"t\\":{\\"t\\":13,\\"i\\":0,\\"c\\":\\"ReferenceError\\",\\"m\\":\\"A\\",\\"d\\":{\\"k\\":[\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":1}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`Error > toJSON > supports other Error classes 1`] = `"{\\"t\\":{\\"t\\":13,\\"i\\":0,\\"c\\":\\"ReferenceError\\",\\"m\\":\\"A\\",\\"p\\":{\\"k\\":[\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":1}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`Error > toJSONAsync > supports Error.prototype.cause 1`] = `"{\\"t\\":{\\"t\\":13,\\"i\\":0,\\"c\\":\\"Error\\",\\"m\\":\\"B\\",\\"d\\":{\\"k\\":[\\"stack\\",\\"cause\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"},{\\"t\\":12,\\"i\\":1,\\"s\\":1,\\"f\\":{\\"t\\":13,\\"i\\":2,\\"c\\":\\"Error\\",\\"m\\":\\"A\\",\\"d\\":{\\"k\\":[\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":1}}}],\\"s\\":2}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`Error > toJSONAsync > supports Error.prototype.cause 1`] = `"{\\"t\\":{\\"t\\":13,\\"i\\":0,\\"c\\":\\"Error\\",\\"m\\":\\"B\\",\\"p\\":{\\"k\\":[\\"stack\\",\\"cause\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"},{\\"t\\":12,\\"i\\":1,\\"s\\":1,\\"f\\":{\\"t\\":13,\\"i\\":2,\\"c\\":\\"Error\\",\\"m\\":\\"A\\",\\"p\\":{\\"k\\":[\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":1}}}],\\"s\\":2}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`Error > toJSONAsync > supports Error.prototype.name 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":13,\\"i\\":1,\\"c\\":\\"Error\\",\\"m\\":\\"A\\",\\"d\\":{\\"k\\":[\\"name\\",\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"ExampleError\\"},{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":2}}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`Error > toJSONAsync > supports Error.prototype.name 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":13,\\"i\\":1,\\"c\\":\\"Error\\",\\"m\\":\\"A\\",\\"p\\":{\\"k\\":[\\"name\\",\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"ExampleError\\"},{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":2}}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`Error > toJSONAsync > supports other Error classes 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":13,\\"i\\":1,\\"c\\":\\"ReferenceError\\",\\"m\\":\\"A\\",\\"d\\":{\\"k\\":[\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":1}}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`Error > toJSONAsync > supports other Error classes 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":13,\\"i\\":1,\\"c\\":\\"ReferenceError\\",\\"m\\":\\"A\\",\\"p\\":{\\"k\\":[\\"stack\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"\\"}],\\"s\\":1}}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
12 changes: 6 additions & 6 deletions packages/seroval/test/__snapshots__/frozen-object.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ exports[`frozen object > serializeAsync > supports Symbol.iterator 1`] = `"((h,j

exports[`frozen object > serializeAsync > supports self-recursion 1`] = `"(h=>(h={a:Promise.resolve().then(()=>h),b:Promise.resolve().then(()=>h)},Object.freeze(h),h))()"`;

exports[`frozen object > toJSON > supports Objects 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"d\\":{\\"k\\":[\\"hello\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"world\\"}],\\"s\\":1},\\"o\\":3},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`frozen object > toJSON > supports Objects 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"p\\":{\\"k\\":[\\"hello\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"world\\"}],\\"s\\":1},\\"o\\":3},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`frozen object > toJSON > supports Symbol.iterator 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"d\\":{\\"k\\":[0],\\"v\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":3,\\"a\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":3}],\\"o\\":0}],\\"s\\":1},\\"o\\":3},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`frozen object > toJSON > supports Symbol.iterator 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"p\\":{\\"k\\":[0],\\"v\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":3,\\"a\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":3}],\\"o\\":0}],\\"s\\":1},\\"o\\":3},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`frozen object > toJSON > supports self-recursion 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"d\\":{\\"k\\":[\\"a\\",\\"b\\"],\\"v\\":[{\\"t\\":4,\\"i\\":0},{\\"t\\":4,\\"i\\":0}],\\"s\\":2},\\"o\\":3},\\"r\\":0,\\"f\\":16383,\\"m\\":[0]}"`;
exports[`frozen object > toJSON > supports self-recursion 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"p\\":{\\"k\\":[\\"a\\",\\"b\\"],\\"v\\":[{\\"t\\":4,\\"i\\":0},{\\"t\\":4,\\"i\\":0}],\\"s\\":2},\\"o\\":3},\\"r\\":0,\\"f\\":16383,\\"m\\":[0]}"`;

exports[`frozen object > toJSONAsync > supports Objects 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":10,\\"i\\":1,\\"d\\":{\\"k\\":[\\"hello\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"world\\"}],\\"s\\":1},\\"o\\":3}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`frozen object > toJSONAsync > supports Objects 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":10,\\"i\\":1,\\"p\\":{\\"k\\":[\\"hello\\"],\\"v\\":[{\\"t\\":1,\\"s\\":\\"world\\"}],\\"s\\":1},\\"o\\":3}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`frozen object > toJSONAsync > supports Symbol.iterator 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":10,\\"i\\":1,\\"d\\":{\\"k\\":[0],\\"v\\":[{\\"t\\":9,\\"i\\":2,\\"l\\":3,\\"a\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":3}],\\"o\\":0}],\\"s\\":1},\\"o\\":3}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`frozen object > toJSONAsync > supports Symbol.iterator 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":10,\\"i\\":1,\\"p\\":{\\"k\\":[0],\\"v\\":[{\\"t\\":9,\\"i\\":2,\\"l\\":3,\\"a\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":3}],\\"o\\":0}],\\"s\\":1},\\"o\\":3}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`frozen object > toJSONAsync > supports self-recursion 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"d\\":{\\"k\\":[\\"a\\",\\"b\\"],\\"v\\":[{\\"t\\":12,\\"i\\":1,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":0}},{\\"t\\":12,\\"i\\":2,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":0}}],\\"s\\":2},\\"o\\":3},\\"r\\":0,\\"f\\":16383,\\"m\\":[0]}"`;
exports[`frozen object > toJSONAsync > supports self-recursion 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"p\\":{\\"k\\":[\\"a\\",\\"b\\"],\\"v\\":[{\\"t\\":12,\\"i\\":1,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":0}},{\\"t\\":12,\\"i\\":2,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":0}}],\\"s\\":2},\\"o\\":3},\\"r\\":0,\\"f\\":16383,\\"m\\":[0]}"`;
10 changes: 5 additions & 5 deletions packages/seroval/test/__snapshots__/iterable.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ exports[`Iterable > compat > should use functions instead of method shorthand. 1

exports[`Iterable > compat > should use method shorthand instead of arrow functions. 1`] = `"(function(h){return h={[Symbol.iterator](){return [h].values()}}})()"`;

exports[`Iterable > compat#toJSON > should use Symbol.iterator instead of Array.values. 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"d\\":{\\"k\\":[0],\\"v\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":4,\\"i\\":0}],\\"o\\":0}],\\"s\\":1},\\"o\\":0},\\"r\\":0,\\"f\\":16381,\\"m\\":[0]}"`;
exports[`Iterable > compat#toJSON > should use Symbol.iterator instead of Array.values. 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"p\\":{\\"k\\":[0],\\"v\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":4,\\"i\\":0}],\\"o\\":0}],\\"s\\":1},\\"o\\":0},\\"r\\":0,\\"f\\":16381,\\"m\\":[0]}"`;

exports[`Iterable > compat#toJSON > should use Symbol.iterator instead of Array.values. 2`] = `"(h=>(h={[Symbol.iterator]:()=>[h][Symbol.iterator]()}))()"`;

exports[`Iterable > compat#toJSON > should use functions instead of method shorthand. 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"d\\":{\\"k\\":[0],\\"v\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":4,\\"i\\":0}],\\"o\\":0}],\\"s\\":1},\\"o\\":0},\\"r\\":0,\\"f\\":16315,\\"m\\":[0]}"`;
exports[`Iterable > compat#toJSON > should use functions instead of method shorthand. 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"p\\":{\\"k\\":[0],\\"v\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":4,\\"i\\":0}],\\"o\\":0}],\\"s\\":1},\\"o\\":0},\\"r\\":0,\\"f\\":16315,\\"m\\":[0]}"`;

exports[`Iterable > compat#toJSON > should use functions instead of method shorthand. 2`] = `"(function(h){return h={[Symbol.iterator]:function(){return [h].values()}}})()"`;

exports[`Iterable > compat#toJSON > should use method shorthand instead of arrow functions. 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"d\\":{\\"k\\":[0],\\"v\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":4,\\"i\\":0}],\\"o\\":0}],\\"s\\":1},\\"o\\":0},\\"r\\":0,\\"f\\":16379,\\"m\\":[0]}"`;
exports[`Iterable > compat#toJSON > should use method shorthand instead of arrow functions. 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"p\\":{\\"k\\":[0],\\"v\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":4,\\"i\\":0}],\\"o\\":0}],\\"s\\":1},\\"o\\":0},\\"r\\":0,\\"f\\":16379,\\"m\\":[0]}"`;

exports[`Iterable > compat#toJSON > should use method shorthand instead of arrow functions. 2`] = `"(function(h){return h={[Symbol.iterator](){return [h].values()}}})()"`;

exports[`Iterable > serialize > supports Iterables 1`] = `"({title:\\"Hello World\\",[Symbol.iterator]:()=>[1,2,3].values()})"`;

exports[`Iterable > serializeAsync > supports Iterables 1`] = `"Promise.resolve({title:\\"Hello World\\",[Symbol.iterator]:()=>[1,2,3].values()})"`;

exports[`Iterable > toJSON > supports Iterables 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"d\\":{\\"k\\":[\\"title\\",0],\\"v\\":[{\\"t\\":1,\\"s\\":\\"Hello World\\"},{\\"t\\":9,\\"i\\":1,\\"l\\":3,\\"a\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":3}],\\"o\\":0}],\\"s\\":2},\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`Iterable > toJSON > supports Iterables 1`] = `"{\\"t\\":{\\"t\\":10,\\"i\\":0,\\"p\\":{\\"k\\":[\\"title\\",0],\\"v\\":[{\\"t\\":1,\\"s\\":\\"Hello World\\"},{\\"t\\":9,\\"i\\":1,\\"l\\":3,\\"a\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":3}],\\"o\\":0}],\\"s\\":2},\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`Iterable > toJSONAsync > supports Iterables 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":10,\\"i\\":1,\\"d\\":{\\"k\\":[\\"title\\",0],\\"v\\":[{\\"t\\":1,\\"s\\":\\"Hello World\\"},{\\"t\\":9,\\"i\\":2,\\"l\\":3,\\"a\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":3}],\\"o\\":0}],\\"s\\":2},\\"o\\":0}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`Iterable > toJSONAsync > supports Iterables 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":10,\\"i\\":1,\\"p\\":{\\"k\\":[\\"title\\",0],\\"v\\":[{\\"t\\":1,\\"s\\":\\"Hello World\\"},{\\"t\\":9,\\"i\\":2,\\"l\\":3,\\"a\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":3}],\\"o\\":0}],\\"s\\":2},\\"o\\":0}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
8 changes: 4 additions & 4 deletions packages/seroval/test/__snapshots__/map.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ exports[`Map > serializeAsync > supports Map 1`] = `"Promise.resolve(new Map([[1

exports[`Map > serializeAsync > supports self-recursion 1`] = `"(h=>(h=new Map([[Promise.resolve().then(()=>h),Promise.resolve().then(()=>h)]])))()"`;

exports[`Map > toJSON > supports Map 1`] = `"{\\"t\\":{\\"t\\":8,\\"i\\":0,\\"d\\":{\\"k\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":3}],\\"v\\":[{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":4}],\\"s\\":2}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`Map > toJSON > supports Map 1`] = `"{\\"t\\":{\\"t\\":8,\\"i\\":0,\\"e\\":{\\"k\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":3}],\\"v\\":[{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":4}],\\"s\\":2}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`Map > toJSON > supports self-recursion 1`] = `"{\\"t\\":{\\"t\\":8,\\"i\\":0,\\"d\\":{\\"k\\":[{\\"t\\":4,\\"i\\":0}],\\"v\\":[{\\"t\\":4,\\"i\\":0}],\\"s\\":1}},\\"r\\":0,\\"f\\":16383,\\"m\\":[0]}"`;
exports[`Map > toJSON > supports self-recursion 1`] = `"{\\"t\\":{\\"t\\":8,\\"i\\":0,\\"e\\":{\\"k\\":[{\\"t\\":4,\\"i\\":0}],\\"v\\":[{\\"t\\":4,\\"i\\":0}],\\"s\\":1}},\\"r\\":0,\\"f\\":16383,\\"m\\":[0]}"`;

exports[`Map > toJSONAsync > supports Map 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":8,\\"i\\":1,\\"d\\":{\\"k\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":3}],\\"v\\":[{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":4}],\\"s\\":2}}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;
exports[`Map > toJSONAsync > supports Map 1`] = `"{\\"t\\":{\\"t\\":12,\\"i\\":0,\\"s\\":1,\\"f\\":{\\"t\\":8,\\"i\\":1,\\"e\\":{\\"k\\":[{\\"t\\":0,\\"s\\":1},{\\"t\\":0,\\"s\\":3}],\\"v\\":[{\\"t\\":0,\\"s\\":2},{\\"t\\":0,\\"s\\":4}],\\"s\\":2}}},\\"r\\":0,\\"f\\":16383,\\"m\\":[]}"`;

exports[`Map > toJSONAsync > supports self-recursion 1`] = `"{\\"t\\":{\\"t\\":8,\\"i\\":0,\\"d\\":{\\"k\\":[{\\"t\\":12,\\"i\\":1,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":0}}],\\"v\\":[{\\"t\\":12,\\"i\\":2,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":0}}],\\"s\\":1}},\\"r\\":0,\\"f\\":16383,\\"m\\":[0]}"`;
exports[`Map > toJSONAsync > supports self-recursion 1`] = `"{\\"t\\":{\\"t\\":8,\\"i\\":0,\\"e\\":{\\"k\\":[{\\"t\\":12,\\"i\\":1,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":0}}],\\"v\\":[{\\"t\\":12,\\"i\\":2,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":0}}],\\"s\\":1}},\\"r\\":0,\\"f\\":16383,\\"m\\":[0]}"`;
8 changes: 4 additions & 4 deletions packages/seroval/test/__snapshots__/mutual-cycle.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ exports[`mutual cyclic references > serializeAsync > supports Objects and Object

exports[`mutual cyclic references > toJSON > supports Arrays and Arrays 1`] = `"{\\"t\\":{\\"t\\":9,\\"i\\":0,\\"l\\":2,\\"a\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":9,\\"i\\":2,\\"l\\":1,\\"a\\":[{\\"t\\":4,\\"i\\":1}],\\"o\\":0}],\\"o\\":0},{\\"t\\":4,\\"i\\":2}],\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[1,2]}"`;

exports[`mutual cyclic references > toJSON > supports Arrays and Objects 1`] = `"{\\"t\\":{\\"t\\":9,\\"i\\":0,\\"l\\":2,\\"a\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":10,\\"i\\":2,\\"d\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":4,\\"i\\":1}],\\"s\\":1},\\"o\\":0}],\\"o\\":0},{\\"t\\":4,\\"i\\":2}],\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[1,2]}"`;
exports[`mutual cyclic references > toJSON > supports Arrays and Objects 1`] = `"{\\"t\\":{\\"t\\":9,\\"i\\":0,\\"l\\":2,\\"a\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":10,\\"i\\":2,\\"p\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":4,\\"i\\":1}],\\"s\\":1},\\"o\\":0}],\\"o\\":0},{\\"t\\":4,\\"i\\":2}],\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[1,2]}"`;

exports[`mutual cyclic references > toJSON > supports Objects and Objects 1`] = `"{\\"t\\":{\\"t\\":9,\\"i\\":0,\\"l\\":2,\\"a\\":[{\\"t\\":10,\\"i\\":1,\\"d\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":10,\\"i\\":2,\\"d\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":4,\\"i\\":1}],\\"s\\":1},\\"o\\":0}],\\"s\\":1},\\"o\\":0},{\\"t\\":4,\\"i\\":2}],\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[1,2]}"`;
exports[`mutual cyclic references > toJSON > supports Objects and Objects 1`] = `"{\\"t\\":{\\"t\\":9,\\"i\\":0,\\"l\\":2,\\"a\\":[{\\"t\\":10,\\"i\\":1,\\"p\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":10,\\"i\\":2,\\"p\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":4,\\"i\\":1}],\\"s\\":1},\\"o\\":0}],\\"s\\":1},\\"o\\":0},{\\"t\\":4,\\"i\\":2}],\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[1,2]}"`;

exports[`mutual cyclic references > toJSONAsync > supports Arrays and Arrays 1`] = `"{\\"t\\":{\\"t\\":9,\\"i\\":0,\\"l\\":2,\\"a\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":12,\\"i\\":2,\\"s\\":1,\\"f\\":{\\"t\\":9,\\"i\\":3,\\"l\\":1,\\"a\\":[{\\"t\\":12,\\"i\\":4,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":1}}],\\"o\\":0}}],\\"o\\":0},{\\"t\\":4,\\"i\\":3}],\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[1,3]}"`;

exports[`mutual cyclic references > toJSONAsync > supports Arrays and Objects 1`] = `"{\\"t\\":{\\"t\\":9,\\"i\\":0,\\"l\\":2,\\"a\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":12,\\"i\\":2,\\"s\\":1,\\"f\\":{\\"t\\":10,\\"i\\":3,\\"d\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":12,\\"i\\":4,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":1}}],\\"s\\":1},\\"o\\":0}}],\\"o\\":0},{\\"t\\":4,\\"i\\":3}],\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[1,3]}"`;
exports[`mutual cyclic references > toJSONAsync > supports Arrays and Objects 1`] = `"{\\"t\\":{\\"t\\":9,\\"i\\":0,\\"l\\":2,\\"a\\":[{\\"t\\":9,\\"i\\":1,\\"l\\":1,\\"a\\":[{\\"t\\":12,\\"i\\":2,\\"s\\":1,\\"f\\":{\\"t\\":10,\\"i\\":3,\\"p\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":12,\\"i\\":4,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":1}}],\\"s\\":1},\\"o\\":0}}],\\"o\\":0},{\\"t\\":4,\\"i\\":3}],\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[1,3]}"`;

exports[`mutual cyclic references > toJSONAsync > supports Objects and Objects 1`] = `"{\\"t\\":{\\"t\\":9,\\"i\\":0,\\"l\\":2,\\"a\\":[{\\"t\\":10,\\"i\\":1,\\"d\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":12,\\"i\\":2,\\"s\\":1,\\"f\\":{\\"t\\":10,\\"i\\":3,\\"d\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":12,\\"i\\":4,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":1}}],\\"s\\":1},\\"o\\":0}}],\\"s\\":1},\\"o\\":0},{\\"t\\":4,\\"i\\":3}],\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[1,3]}"`;
exports[`mutual cyclic references > toJSONAsync > supports Objects and Objects 1`] = `"{\\"t\\":{\\"t\\":9,\\"i\\":0,\\"l\\":2,\\"a\\":[{\\"t\\":10,\\"i\\":1,\\"p\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":12,\\"i\\":2,\\"s\\":1,\\"f\\":{\\"t\\":10,\\"i\\":3,\\"p\\":{\\"k\\":[\\"0\\"],\\"v\\":[{\\"t\\":12,\\"i\\":4,\\"s\\":1,\\"f\\":{\\"t\\":4,\\"i\\":1}}],\\"s\\":1},\\"o\\":0}}],\\"s\\":1},\\"o\\":0},{\\"t\\":4,\\"i\\":3}],\\"o\\":0},\\"r\\":0,\\"f\\":16383,\\"m\\":[1,3]}"`;
Loading

0 comments on commit 63a2005

Please sign in to comment.