seroval 0.11.4 → 0.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/development/index.cjs +152 -127
- package/dist/cjs/development/index.cjs.map +2 -2
- package/dist/cjs/production/index.cjs +2 -2
- package/dist/esm/development/index.mjs +152 -127
- package/dist/esm/development/index.mjs.map +2 -2
- package/dist/esm/production/index.mjs +2 -2
- package/package.json +2 -2
- package/src/core/cross/async.ts +40 -32
- package/src/core/cross/stream.ts +38 -33
- package/src/core/cross/sync.ts +22 -21
- package/src/core/shared.ts +5 -6
- package/src/core/tree/async.ts +40 -32
- package/src/core/tree/sync.ts +22 -21
package/src/core/tree/async.ts
CHANGED
|
@@ -660,48 +660,56 @@ async function parseObject(
|
|
|
660
660
|
current as unknown as Set<unknown>,
|
|
661
661
|
);
|
|
662
662
|
}
|
|
663
|
+
// Promises
|
|
664
|
+
if (
|
|
665
|
+
(ctx.features & Feature.Promise)
|
|
666
|
+
&& (currentClass === Promise || current instanceof Promise)
|
|
667
|
+
) {
|
|
668
|
+
return generatePromiseNode(ctx, id, current as unknown as Promise<unknown>);
|
|
669
|
+
}
|
|
663
670
|
// Web APIs
|
|
664
671
|
if (ctx.features & Feature.WebAPI) {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
672
|
+
if (typeof URL !== 'undefined' && currentClass === URL) {
|
|
673
|
+
return createURLNode(id, current as unknown as URL);
|
|
674
|
+
}
|
|
675
|
+
if (typeof URLSearchParams !== 'undefined' && currentClass === URLSearchParams) {
|
|
676
|
+
return createURLSearchParamsNode(id, current as unknown as URLSearchParams);
|
|
677
|
+
}
|
|
678
|
+
if (typeof Blob !== 'undefined' && currentClass === Blob) {
|
|
679
|
+
return createBlobNode(ctx, id, current as unknown as Blob);
|
|
680
|
+
}
|
|
681
|
+
if (typeof File !== 'undefined' && currentClass === File) {
|
|
682
|
+
return createFileNode(ctx, id, current as unknown as File);
|
|
683
|
+
}
|
|
684
|
+
if (typeof Headers !== 'undefined' && currentClass === Headers) {
|
|
685
|
+
return generateHeadersNode(ctx, id, current as unknown as Headers);
|
|
686
|
+
}
|
|
687
|
+
if (typeof FormData !== 'undefined' && currentClass === FormData) {
|
|
688
|
+
return generateFormDataNode(ctx, id, current as unknown as FormData);
|
|
689
|
+
}
|
|
690
|
+
if (typeof Request !== 'undefined' && currentClass === Request) {
|
|
691
|
+
return generateRequestNode(ctx, id, current as unknown as Request);
|
|
692
|
+
}
|
|
693
|
+
if (typeof Response !== 'undefined' && currentClass === Response) {
|
|
694
|
+
return generateResponseNode(ctx, id, current as unknown as Response);
|
|
695
|
+
}
|
|
696
|
+
if (typeof Event !== 'undefined' && currentClass === Event) {
|
|
697
|
+
return generateEventNode(ctx, id, current as unknown as Event);
|
|
698
|
+
}
|
|
699
|
+
if (typeof CustomEvent !== 'undefined' && currentClass === CustomEvent) {
|
|
700
|
+
return generateCustomEventNode(ctx, id, current as unknown as CustomEvent);
|
|
701
|
+
}
|
|
702
|
+
if (typeof DOMException !== 'undefined' && currentClass === DOMException) {
|
|
703
|
+
return createDOMExceptionNode(id, current as unknown as DOMException);
|
|
690
704
|
}
|
|
691
705
|
}
|
|
692
706
|
if (
|
|
693
707
|
(ctx.features & Feature.AggregateError)
|
|
708
|
+
&& typeof AggregateError !== 'undefined'
|
|
694
709
|
&& (currentClass === AggregateError || current instanceof AggregateError)
|
|
695
710
|
) {
|
|
696
711
|
return generateAggregateErrorNode(ctx, id, current as unknown as AggregateError);
|
|
697
712
|
}
|
|
698
|
-
// Promises
|
|
699
|
-
if (
|
|
700
|
-
(ctx.features & Feature.Promise)
|
|
701
|
-
&& (currentClass === Promise || current instanceof Promise)
|
|
702
|
-
) {
|
|
703
|
-
return generatePromiseNode(ctx, id, current as unknown as Promise<unknown>);
|
|
704
|
-
}
|
|
705
713
|
// Slow path. We only need to handle Errors and Iterators
|
|
706
714
|
// since they have very broad implementations.
|
|
707
715
|
if (current instanceof Error) {
|
package/src/core/tree/sync.ts
CHANGED
|
@@ -555,31 +555,32 @@ function parseObject(
|
|
|
555
555
|
}
|
|
556
556
|
// Web APIs
|
|
557
557
|
if (ctx.features & Feature.WebAPI) {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
558
|
+
if (typeof URL !== 'undefined' && currentClass === URL) {
|
|
559
|
+
return createURLNode(id, current as unknown as URL);
|
|
560
|
+
}
|
|
561
|
+
if (typeof URLSearchParams !== 'undefined' && currentClass === URLSearchParams) {
|
|
562
|
+
return createURLSearchParamsNode(id, current as unknown as URLSearchParams);
|
|
563
|
+
}
|
|
564
|
+
if (typeof Headers !== 'undefined' && currentClass === Headers) {
|
|
565
|
+
return generateHeadersNode(ctx, id, current as unknown as Headers);
|
|
566
|
+
}
|
|
567
|
+
if (typeof FormData !== 'undefined' && currentClass === FormData) {
|
|
568
|
+
return generateFormDataNode(ctx, id, current as unknown as FormData);
|
|
569
|
+
}
|
|
570
|
+
if (typeof Event !== 'undefined' && currentClass === Event) {
|
|
571
|
+
return generateEventNode(ctx, id, current as unknown as Event);
|
|
572
|
+
}
|
|
573
|
+
if (typeof CustomEvent !== 'undefined' && currentClass === CustomEvent) {
|
|
574
|
+
return generateCustomEventNode(ctx, id, current as unknown as CustomEvent);
|
|
575
|
+
}
|
|
576
|
+
if (typeof DOMException !== 'undefined' && currentClass === DOMException) {
|
|
577
|
+
return createDOMExceptionNode(id, current as unknown as DOMException);
|
|
575
578
|
}
|
|
576
579
|
}
|
|
577
580
|
if (
|
|
578
581
|
(ctx.features & Feature.AggregateError)
|
|
579
|
-
&&
|
|
580
|
-
|
|
581
|
-
|| current instanceof AggregateError
|
|
582
|
-
)
|
|
582
|
+
&& typeof AggregateError !== 'undefined'
|
|
583
|
+
&& (currentClass === AggregateError || current instanceof AggregateError)
|
|
583
584
|
) {
|
|
584
585
|
return generateAggregateErrorNode(ctx, id, current as unknown as AggregateError);
|
|
585
586
|
}
|