Skip to content

Commit

Permalink
Add auto cross-ref header
Browse files Browse the repository at this point in the history
  • Loading branch information
lxsmnsyc committed Nov 24, 2023
1 parent 9342468 commit 2c41e36
Show file tree
Hide file tree
Showing 43 changed files with 456 additions and 454 deletions.
7 changes: 1 addition & 6 deletions docs/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ import { compileJSON } from 'seroval';
import { crossSerialize, crossSerializeAsync } from 'seroval';
```

Cross-reference serialization provides a different JS output, and so requires prepending a header script provided by `GLOBAL_CONTEXT_API_SCRIPT` and `getCrossReferenceHeader`.

## Streaming serialization

Async serialization allows `Promise` instances to be serialized by `await`-ing it, however, this results in a blocking process. With streaming serialization, `Promise` instances can be streamed later on, while the synchronous values can be emitted immediately.
Expand Down Expand Up @@ -86,10 +84,7 @@ const stop = crossSerializeStream(data, {
});
```

Like other cross-reference serialization:

- you can define `refs` for mapping cross-referenced values.
- `crossSerializeStream` would require both `GLOBAL_CONTEXT_API_SCRIPT` and `getCrossReferenceHeader`.
Like other cross-reference serialization, you can define `refs` for mapping cross-referenced values.

### `Serializer`

Expand Down
13 changes: 11 additions & 2 deletions packages/seroval/src/core/cross/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getCrossReferenceHeader } from '../keys';
import type { SerovalNode } from '../types';
import type { CrossAsyncParserContextOptions } from './async';
import AsyncCrossParserContext from './async';
Expand All @@ -10,6 +11,10 @@ import StreamCrossParserContext from './stream';
import type { CrossSyncParserContextOptions } from './sync';
import SyncCrossParserContext from './sync';

function insertCrossReferenceHeader(scopeId: string | undefined, value: string): string {
return '(' + getCrossReferenceHeader(scopeId) + ',' + value + ')';
}

export interface CrossSerializeOptions
extends CrossSyncParserContextOptions, CrossContextOptions {
}
Expand All @@ -30,7 +35,7 @@ export function crossSerialize<T>(
scopeId: options.scopeId,
markedRefs: ctx.marked,
});
return serial.serializeTop(tree);
return insertCrossReferenceHeader(options.scopeId, serial.serializeTop(tree));
}

export interface CrossSerializeAsyncOptions
Expand All @@ -53,7 +58,7 @@ export async function crossSerializeAsync<T>(
scopeId: options.scopeId,
markedRefs: ctx.marked,
});
return serial.serializeTop(tree);
return insertCrossReferenceHeader(options.scopeId, serial.serializeTop(tree));
}

export type ToCrossJSONOptions = CrossParserContextOptions;
Expand Down Expand Up @@ -116,6 +121,10 @@ export function crossSerializeStream<T>(
return;
}

if (initial) {
serialized = insertCrossReferenceHeader(options.scopeId, serialized);
}

options.onSerialize(
serialized,
initial,
Expand Down
4 changes: 2 additions & 2 deletions packages/seroval/src/core/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const GLOBAL_CONTEXT_R = `self.${GLOBAL_CONTEXT_REFERENCES}`;

export function getCrossReferenceHeader(id?: string): string {
if (id == null) {
return `${GLOBAL_CONTEXT_R}=${GLOBAL_CONTEXT_R}||[];`;
return `${GLOBAL_CONTEXT_R}=${GLOBAL_CONTEXT_R}||[]`;
}
return `(${GLOBAL_CONTEXT_R}=${GLOBAL_CONTEXT_R}||{})["${serializeString(id)}"]=[];`;
return `(${GLOBAL_CONTEXT_R}=${GLOBAL_CONTEXT_R}||{})["${serializeString(id)}"]=[]`;
}
2 changes: 0 additions & 2 deletions packages/seroval/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export { createReference } from './core/reference';
export * from './core/tree';
export * from './core/cross';

export { getCrossReferenceHeader } from './core/keys';

export { default as Serializer } from './core/Serializer';
export * from './core/plugin';

Expand Down
24 changes: 12 additions & 12 deletions packages/seroval/test/__snapshots__/array.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`arrays > crossSerialize > scoped > supports Arrays 1`] = `"($R=>$R[0]=[1,2,3])($R[\\"example\\"])"`;
exports[`arrays > crossSerialize > scoped > supports Arrays 1`] = `"((self.$R=self.$R||{})[\\"example\\"]=[],($R=>$R[0]=[1,2,3])($R[\\"example\\"]))"`;

exports[`arrays > crossSerialize > scoped > supports self recursion 1`] = `"($R=>$R[0]=[,,],$R[0][1]=$R[0][0]=$R[0],$R[0])($R[\\"example\\"])"`;
exports[`arrays > crossSerialize > scoped > supports self recursion 1`] = `"((self.$R=self.$R||{})[\\"example\\"]=[],($R=>$R[0]=[,,],$R[0][1]=$R[0][0]=$R[0],$R[0])($R[\\"example\\"]))"`;

exports[`arrays > crossSerialize > supports Arrays 1`] = `"$R[0]=[1,2,3]"`;
exports[`arrays > crossSerialize > supports Arrays 1`] = `"(self.$R=self.$R||[],$R[0]=[1,2,3])"`;

exports[`arrays > crossSerialize > supports self recursion 1`] = `"($R[0]=[,,],$R[0][1]=$R[0][0]=$R[0],$R[0])"`;
exports[`arrays > crossSerialize > supports self recursion 1`] = `"(self.$R=self.$R||[],($R[0]=[,,],$R[0][1]=$R[0][0]=$R[0],$R[0]))"`;

exports[`arrays > crossSerializeAsync > scoped > supports Arrays 1`] = `"($R=>$R[0]=Promise.resolve($R[1]=[1,2,3]))($R[\\"example\\"])"`;
exports[`arrays > crossSerializeAsync > scoped > supports Arrays 1`] = `"((self.$R=self.$R||{})[\\"example\\"]=[],($R=>$R[0]=Promise.resolve($R[1]=[1,2,3]))($R[\\"example\\"]))"`;

exports[`arrays > crossSerializeAsync > scoped > supports self recursion 1`] = `"($R=>$R[0]=[$R[1]=Promise.resolve().then(()=>$R[0]),$R[2]=Promise.resolve().then(()=>$R[0])])($R[\\"example\\"])"`;
exports[`arrays > crossSerializeAsync > scoped > supports self recursion 1`] = `"((self.$R=self.$R||{})[\\"example\\"]=[],($R=>$R[0]=[$R[1]=Promise.resolve().then(()=>$R[0]),$R[2]=Promise.resolve().then(()=>$R[0])])($R[\\"example\\"]))"`;

exports[`arrays > crossSerializeAsync > supports Arrays 1`] = `"$R[0]=Promise.resolve($R[1]=[1,2,3])"`;
exports[`arrays > crossSerializeAsync > supports Arrays 1`] = `"(self.$R=self.$R||[],$R[0]=Promise.resolve($R[1]=[1,2,3]))"`;

exports[`arrays > crossSerializeAsync > supports self recursion 1`] = `"$R[0]=[$R[1]=Promise.resolve().then(()=>$R[0]),$R[2]=Promise.resolve().then(()=>$R[0])]"`;
exports[`arrays > crossSerializeAsync > supports self recursion 1`] = `"(self.$R=self.$R||[],$R[0]=[$R[1]=Promise.resolve().then(()=>$R[0]),$R[2]=Promise.resolve().then(()=>$R[0])])"`;

exports[`arrays > crossSerializeStream > scoped > supports Arrays 1`] = `"($R=>$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))())($R[\\"example\\"])"`;
exports[`arrays > crossSerializeStream > scoped > supports Arrays 1`] = `"((self.$R=self.$R||{})[\\"example\\"]=[],($R=>$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))())($R[\\"example\\"]))"`;

exports[`arrays > crossSerializeStream > scoped > supports Arrays 2`] = `"($R=>($R[3]=(p,d)=>{p.s(d),p.status=\\"success\\",p.value=d;delete p.s;delete p.f})($R[0],$R[2]=[1,2,3]))($R[\\"example\\"])"`;

exports[`arrays > crossSerializeStream > scoped > supports self recursion 1`] = `"($R=>$R[0]=[$R[1]=($R[2]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))(),$R[3]=$R[2]()])($R[\\"example\\"])"`;
exports[`arrays > crossSerializeStream > scoped > supports self recursion 1`] = `"((self.$R=self.$R||{})[\\"example\\"]=[],($R=>$R[0]=[$R[1]=($R[2]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))(),$R[3]=$R[2]()])($R[\\"example\\"]))"`;

exports[`arrays > crossSerializeStream > scoped > supports self recursion 2`] = `"($R=>($R[4]=(p,d)=>{p.s(d),p.status=\\"success\\",p.value=d;delete p.s;delete p.f})($R[1],$R[0]))($R[\\"example\\"])"`;

exports[`arrays > crossSerializeStream > scoped > supports self recursion 3`] = `"($R=>$R[4]($R[3],$R[0]))($R[\\"example\\"])"`;

exports[`arrays > crossSerializeStream > supports Arrays 1`] = `"$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))()"`;
exports[`arrays > crossSerializeStream > supports Arrays 1`] = `"(self.$R=self.$R||[],$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))())"`;

exports[`arrays > crossSerializeStream > supports Arrays 2`] = `"($R[3]=(p,d)=>{p.s(d),p.status=\\"success\\",p.value=d;delete p.s;delete p.f})($R[0],$R[2]=[1,2,3])"`;

exports[`arrays > crossSerializeStream > supports self recursion 1`] = `"$R[0]=[$R[1]=($R[2]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))(),$R[3]=$R[2]()]"`;
exports[`arrays > crossSerializeStream > supports self recursion 1`] = `"(self.$R=self.$R||[],$R[0]=[$R[1]=($R[2]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))(),$R[3]=$R[2]()])"`;

exports[`arrays > crossSerializeStream > supports self recursion 2`] = `"($R[4]=(p,d)=>{p.s(d),p.status=\\"success\\",p.value=d;delete p.s;delete p.f})($R[1],$R[0])"`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ exports[`AsyncIterable > compat#toJSONAsync > should use function expression ins

exports[`AsyncIterable > compat#toJSONAsync > should use function expression instead of arrow functions. 2`] = `"(function(h,j){return ({title:\\"Hello World\\",[h=Symbol.asyncIterator]:(function(s){return function(i,t){return (i=0,t={[h]:function(){return t},next:function(){return Promise.resolve().then(function(c,d){if(i>s.d)return{done:!0,value:void 0};c=i++,d=s.v[c];if(c===s.t)throw d;return{done:c===s.d,value:d}})}})}})({v:[1,2,3,void 0],t:-1,d:3})})})()"`;

exports[`AsyncIterable > crossSerializeAsync > scoped > supports AsyncIterables 1`] = `"($R=>$R[0]={title:\\"Hello World\\",[$R[1]=Symbol.asyncIterator]:($R[2]=s=>(i,t)=>(i=0,t={[$R[1]]:()=>t,next:()=>Promise.resolve().then((c,d)=>{if(i>s.d)return{done:!0,value:void 0};c=i++,d=s.v[c];if(c===s.t)throw d;return{done:c===s.d,value:d}})}))($R[3]={v:$R[4]=[1,2,3,void 0],t:-1,d:3})})($R[\\"example\\"])"`;
exports[`AsyncIterable > crossSerializeAsync > scoped > supports AsyncIterables 1`] = `"((self.$R=self.$R||{})[\\"example\\"]=[],($R=>$R[0]={title:\\"Hello World\\",[$R[1]=Symbol.asyncIterator]:($R[2]=s=>(i,t)=>(i=0,t={[$R[1]]:()=>t,next:()=>Promise.resolve().then((c,d)=>{if(i>s.d)return{done:!0,value:void 0};c=i++,d=s.v[c];if(c===s.t)throw d;return{done:c===s.d,value:d}})}))($R[3]={v:$R[4]=[1,2,3,void 0],t:-1,d:3})})($R[\\"example\\"]))"`;

exports[`AsyncIterable > crossSerializeAsync > supports AsyncIterables 1`] = `"$R[0]={title:\\"Hello World\\",[$R[1]=Symbol.asyncIterator]:($R[2]=s=>(i,t)=>(i=0,t={[$R[1]]:()=>t,next:()=>Promise.resolve().then((c,d)=>{if(i>s.d)return{done:!0,value:void 0};c=i++,d=s.v[c];if(c===s.t)throw d;return{done:c===s.d,value:d}})}))($R[3]={v:$R[4]=[1,2,3,void 0],t:-1,d:3})}"`;
exports[`AsyncIterable > crossSerializeAsync > supports AsyncIterables 1`] = `"(self.$R=self.$R||[],$R[0]={title:\\"Hello World\\",[$R[1]=Symbol.asyncIterator]:($R[2]=s=>(i,t)=>(i=0,t={[$R[1]]:()=>t,next:()=>Promise.resolve().then((c,d)=>{if(i>s.d)return{done:!0,value:void 0};c=i++,d=s.v[c];if(c===s.t)throw d;return{done:c===s.d,value:d}})}))($R[3]={v:$R[4]=[1,2,3,void 0],t:-1,d:3})})"`;

exports[`AsyncIterable > crossSerializeStream > scoped > supports AsyncIterables 1`] = `"($R=>$R[0]={title:\\"Hello World\\",[$R[1]=Symbol.asyncIterator]:($R[2]=s=>(b,t)=>(b=s.tee(),s=b[0],b=b[1].getReader(),t={[$R[1]]:()=>t,next:()=>b.read().then(d=>{if(d.done)return{done:!0,value:void 0};d=d.value;if(d[0]===1)throw d[1];return{done:d[0]===2,value:d[1]}})}))($R[3]=($R[4]=(s,c)=>((s=new ReadableStream({start:x=>{c=x}})).c=c,s))())})($R[\\"example\\"])"`;
exports[`AsyncIterable > crossSerializeStream > scoped > supports AsyncIterables 1`] = `"((self.$R=self.$R||{})[\\"example\\"]=[],($R=>$R[0]={title:\\"Hello World\\",[$R[1]=Symbol.asyncIterator]:($R[2]=s=>(b,t)=>(b=s.tee(),s=b[0],b=b[1].getReader(),t={[$R[1]]:()=>t,next:()=>b.read().then(d=>{if(d.done)return{done:!0,value:void 0};d=d.value;if(d[0]===1)throw d[1];return{done:d[0]===2,value:d[1]}})}))($R[3]=($R[4]=(s,c)=>((s=new ReadableStream({start:x=>{c=x}})).c=c,s))())})($R[\\"example\\"]))"`;

exports[`AsyncIterable > crossSerializeStream > scoped > supports AsyncIterables 2`] = `"($R=>($R[6]=(s,d)=>{s.c.enqueue(d)})($R[3],$R[5]=[0,1]))($R[\\"example\\"])"`;

Expand All @@ -22,7 +22,7 @@ exports[`AsyncIterable > crossSerializeStream > scoped > supports AsyncIterables

exports[`AsyncIterable > crossSerializeStream > scoped > supports AsyncIterables 6`] = `"($R=>($R[10]=s=>{s.c.close();delete s.c})($R[3]))($R[\\"example\\"])"`;

exports[`AsyncIterable > crossSerializeStream > supports AsyncIterables 1`] = `"$R[0]={title:\\"Hello World\\",[$R[1]=Symbol.asyncIterator]:($R[2]=s=>(b,t)=>(b=s.tee(),s=b[0],b=b[1].getReader(),t={[$R[1]]:()=>t,next:()=>b.read().then(d=>{if(d.done)return{done:!0,value:void 0};d=d.value;if(d[0]===1)throw d[1];return{done:d[0]===2,value:d[1]}})}))($R[3]=($R[4]=(s,c)=>((s=new ReadableStream({start:x=>{c=x}})).c=c,s))())}"`;
exports[`AsyncIterable > crossSerializeStream > supports AsyncIterables 1`] = `"(self.$R=self.$R||[],$R[0]={title:\\"Hello World\\",[$R[1]=Symbol.asyncIterator]:($R[2]=s=>(b,t)=>(b=s.tee(),s=b[0],b=b[1].getReader(),t={[$R[1]]:()=>t,next:()=>b.read().then(d=>{if(d.done)return{done:!0,value:void 0};d=d.value;if(d[0]===1)throw d[1];return{done:d[0]===2,value:d[1]}})}))($R[3]=($R[4]=(s,c)=>((s=new ReadableStream({start:x=>{c=x}})).c=c,s))())})"`;

exports[`AsyncIterable > crossSerializeStream > supports AsyncIterables 2`] = `"($R[6]=(s,d)=>{s.c.enqueue(d)})($R[3],$R[5]=[0,1])"`;

Expand Down
6 changes: 3 additions & 3 deletions packages/seroval/test/__snapshots__/bigint.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ exports[`bigint > compat > should throw an error for unsupported target 1`] = `"

exports[`bigint > compat#toJSON > should throw an error for unsupported target 1`] = `"Unsupported type \\"[object BigInt]\\""`;

exports[`bigint > crossSerialize > supports bigint 1`] = `"9007199254740991n"`;
exports[`bigint > crossSerialize > supports bigint 1`] = `"(self.$R=self.$R||[],9007199254740991n)"`;

exports[`bigint > crossSerializeAsync > supports bigint 1`] = `"$R[0]=Promise.resolve(9007199254740991n)"`;
exports[`bigint > crossSerializeAsync > supports bigint 1`] = `"(self.$R=self.$R||[],$R[0]=Promise.resolve(9007199254740991n))"`;

exports[`bigint > crossSerializeStream > supports bigint 1`] = `"$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))()"`;
exports[`bigint > crossSerializeStream > supports bigint 1`] = `"(self.$R=self.$R||[],$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))())"`;

exports[`bigint > crossSerializeStream > supports bigint 2`] = `"($R[2]=(p,d)=>{p.s(d),p.status=\\"success\\",p.value=d;delete p.s;delete p.f})($R[0],9007199254740991n)"`;

Expand Down
12 changes: 6 additions & 6 deletions packages/seroval/test/__snapshots__/boolean.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`boolean > crossSerialize > supports boolean 1`] = `"!0"`;
exports[`boolean > crossSerialize > supports boolean 1`] = `"(self.$R=self.$R||[],!0)"`;

exports[`boolean > crossSerialize > supports boolean 2`] = `"!1"`;
exports[`boolean > crossSerialize > supports boolean 2`] = `"(self.$R=self.$R||[],!1)"`;

exports[`boolean > crossSerializeAsync > supports boolean 1`] = `"$R[0]=Promise.resolve(!0)"`;
exports[`boolean > crossSerializeAsync > supports boolean 1`] = `"(self.$R=self.$R||[],$R[0]=Promise.resolve(!0))"`;

exports[`boolean > crossSerializeAsync > supports boolean 2`] = `"$R[0]=Promise.resolve(!1)"`;
exports[`boolean > crossSerializeAsync > supports boolean 2`] = `"(self.$R=self.$R||[],$R[0]=Promise.resolve(!1))"`;

exports[`boolean > crossSerializeStream > supports false value 1`] = `"$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))()"`;
exports[`boolean > crossSerializeStream > supports false value 1`] = `"(self.$R=self.$R||[],$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))())"`;

exports[`boolean > crossSerializeStream > supports false value 2`] = `"($R[2]=(p,d)=>{p.s(d),p.status=\\"success\\",p.value=d;delete p.s;delete p.f})($R[0],!1)"`;

exports[`boolean > crossSerializeStream > supports true value 1`] = `"$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))()"`;
exports[`boolean > crossSerializeStream > supports true value 1`] = `"(self.$R=self.$R||[],$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))())"`;

exports[`boolean > crossSerializeStream > supports true value 2`] = `"($R[2]=(p,d)=>{p.s(d),p.status=\\"success\\",p.value=d;delete p.s;delete p.f})($R[0],!0)"`;

Expand Down
12 changes: 6 additions & 6 deletions packages/seroval/test/__snapshots__/boxed-bigint.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ exports[`boxed bigint > compat > should throw an error for unsupported target 1`

exports[`boxed bigint > compat#toJSON > should throw an error for unsupported target 1`] = `"Unsupported type \\"[object BigInt]\\""`;

exports[`boxed bigint > crossSerialize > scoped > supports boxed bigint 1`] = `"($R=>$R[0]=Object(9007199254740991n))($R[\\"example\\"])"`;
exports[`boxed bigint > crossSerialize > scoped > supports boxed bigint 1`] = `"((self.$R=self.$R||{})[\\"example\\"]=[],($R=>$R[0]=Object(9007199254740991n))($R[\\"example\\"]))"`;

exports[`boxed bigint > crossSerialize > supports boxed bigint 1`] = `"$R[0]=Object(9007199254740991n)"`;
exports[`boxed bigint > crossSerialize > supports boxed bigint 1`] = `"(self.$R=self.$R||[],$R[0]=Object(9007199254740991n))"`;

exports[`boxed bigint > crossSerializeAsync > scoped > supports boxed bigint 1`] = `"($R=>$R[0]=Promise.resolve($R[1]=Object(9007199254740991n)))($R[\\"example\\"])"`;
exports[`boxed bigint > crossSerializeAsync > scoped > supports boxed bigint 1`] = `"((self.$R=self.$R||{})[\\"example\\"]=[],($R=>$R[0]=Promise.resolve($R[1]=Object(9007199254740991n)))($R[\\"example\\"]))"`;

exports[`boxed bigint > crossSerializeAsync > supports boxed bigint 1`] = `"$R[0]=Promise.resolve($R[1]=Object(9007199254740991n))"`;
exports[`boxed bigint > crossSerializeAsync > supports boxed bigint 1`] = `"(self.$R=self.$R||[],$R[0]=Promise.resolve($R[1]=Object(9007199254740991n)))"`;

exports[`boxed bigint > crossSerializeStream > scoped > supports boxed bigint 1`] = `"($R=>$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))())($R[\\"example\\"])"`;
exports[`boxed bigint > crossSerializeStream > scoped > supports boxed bigint 1`] = `"((self.$R=self.$R||{})[\\"example\\"]=[],($R=>$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))())($R[\\"example\\"]))"`;

exports[`boxed bigint > crossSerializeStream > scoped > supports boxed bigint 2`] = `"($R=>($R[3]=(p,d)=>{p.s(d),p.status=\\"success\\",p.value=d;delete p.s;delete p.f})($R[0],$R[2]=Object(9007199254740991n)))($R[\\"example\\"])"`;

exports[`boxed bigint > crossSerializeStream > supports boxed bigint 1`] = `"$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))()"`;
exports[`boxed bigint > crossSerializeStream > supports boxed bigint 1`] = `"(self.$R=self.$R||[],$R[0]=($R[1]=(s,f,p)=>((p=new Promise((a,b)=>{s=a,f=b})).s=s,p.f=f,p))())"`;

exports[`boxed bigint > crossSerializeStream > supports boxed bigint 2`] = `"($R[3]=(p,d)=>{p.s(d),p.status=\\"success\\",p.value=d;delete p.s;delete p.f})($R[0],$R[2]=Object(9007199254740991n))"`;

Expand Down
Loading

0 comments on commit 2c41e36

Please sign in to comment.