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.
@@ -701,12 +701,11 @@ function isIterable(ctx, value) {
701
701
  return false;
702
702
  }
703
703
  if (ctx.features & 8192 /* WebAPI */) {
704
- switch (currentClass) {
705
- case Headers:
706
- case File:
707
- return false;
708
- default:
709
- break;
704
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
705
+ return false;
706
+ }
707
+ if (typeof File !== "undefined" && currentClass === File) {
708
+ return false;
710
709
  }
711
710
  }
712
711
  if (ctx.features & 1024 /* Symbol */) {
@@ -1368,40 +1367,47 @@ async function parseObject(ctx, current) {
1368
1367
  current
1369
1368
  );
1370
1369
  }
1370
+ if (ctx.features & 256 /* Promise */ && (currentClass === Promise || current instanceof Promise)) {
1371
+ return generatePromiseNode(ctx, id, current);
1372
+ }
1371
1373
  if (ctx.features & 8192 /* WebAPI */) {
1372
- switch (currentClass) {
1373
- case URL:
1374
- return createURLNode(id, current);
1375
- case URLSearchParams:
1376
- return createURLSearchParamsNode(id, current);
1377
- case Blob:
1378
- return createBlobNode(ctx, id, current);
1379
- case File:
1380
- return createFileNode(ctx, id, current);
1381
- case Headers:
1382
- return generateHeadersNode(ctx, id, current);
1383
- case FormData:
1384
- return generateFormDataNode(ctx, id, current);
1385
- case Request:
1386
- return generateRequestNode(ctx, id, current);
1387
- case Response:
1388
- return generateResponseNode(ctx, id, current);
1389
- case Event:
1390
- return generateEventNode(ctx, id, current);
1391
- case CustomEvent:
1392
- return generateCustomEventNode(ctx, id, current);
1393
- case DOMException:
1394
- return createDOMExceptionNode(id, current);
1395
- default:
1396
- break;
1374
+ if (typeof URL !== "undefined" && currentClass === URL) {
1375
+ return createURLNode(id, current);
1376
+ }
1377
+ if (typeof URLSearchParams !== "undefined" && currentClass === URLSearchParams) {
1378
+ return createURLSearchParamsNode(id, current);
1379
+ }
1380
+ if (typeof Blob !== "undefined" && currentClass === Blob) {
1381
+ return createBlobNode(ctx, id, current);
1382
+ }
1383
+ if (typeof File !== "undefined" && currentClass === File) {
1384
+ return createFileNode(ctx, id, current);
1385
+ }
1386
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
1387
+ return generateHeadersNode(ctx, id, current);
1388
+ }
1389
+ if (typeof FormData !== "undefined" && currentClass === FormData) {
1390
+ return generateFormDataNode(ctx, id, current);
1391
+ }
1392
+ if (typeof Request !== "undefined" && currentClass === Request) {
1393
+ return generateRequestNode(ctx, id, current);
1394
+ }
1395
+ if (typeof Response !== "undefined" && currentClass === Response) {
1396
+ return generateResponseNode(ctx, id, current);
1397
+ }
1398
+ if (typeof Event !== "undefined" && currentClass === Event) {
1399
+ return generateEventNode(ctx, id, current);
1400
+ }
1401
+ if (typeof CustomEvent !== "undefined" && currentClass === CustomEvent) {
1402
+ return generateCustomEventNode(ctx, id, current);
1403
+ }
1404
+ if (typeof DOMException !== "undefined" && currentClass === DOMException) {
1405
+ return createDOMExceptionNode(id, current);
1397
1406
  }
1398
1407
  }
1399
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
1408
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
1400
1409
  return generateAggregateErrorNode(ctx, id, current);
1401
1410
  }
1402
- if (ctx.features & 256 /* Promise */ && (currentClass === Promise || current instanceof Promise)) {
1403
- return generatePromiseNode(ctx, id, current);
1404
- }
1405
1411
  if (current instanceof Error) {
1406
1412
  return generateErrorNode(ctx, id, current);
1407
1413
  }
@@ -2861,26 +2867,29 @@ function parseObject2(ctx, current) {
2861
2867
  return generateSetNode2(ctx, id, current);
2862
2868
  }
2863
2869
  if (ctx.features & 8192 /* WebAPI */) {
2864
- switch (currentClass) {
2865
- case URL:
2866
- return createURLNode(id, current);
2867
- case URLSearchParams:
2868
- return createURLSearchParamsNode(id, current);
2869
- case Headers:
2870
- return generateHeadersNode2(ctx, id, current);
2871
- case FormData:
2872
- return generateFormDataNode2(ctx, id, current);
2873
- case Event:
2874
- return generateEventNode2(ctx, id, current);
2875
- case CustomEvent:
2876
- return generateCustomEventNode2(ctx, id, current);
2877
- case DOMException:
2878
- return createDOMExceptionNode(id, current);
2879
- default:
2880
- break;
2870
+ if (typeof URL !== "undefined" && currentClass === URL) {
2871
+ return createURLNode(id, current);
2872
+ }
2873
+ if (typeof URLSearchParams !== "undefined" && currentClass === URLSearchParams) {
2874
+ return createURLSearchParamsNode(id, current);
2875
+ }
2876
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
2877
+ return generateHeadersNode2(ctx, id, current);
2878
+ }
2879
+ if (typeof FormData !== "undefined" && currentClass === FormData) {
2880
+ return generateFormDataNode2(ctx, id, current);
2881
+ }
2882
+ if (typeof Event !== "undefined" && currentClass === Event) {
2883
+ return generateEventNode2(ctx, id, current);
2884
+ }
2885
+ if (typeof CustomEvent !== "undefined" && currentClass === CustomEvent) {
2886
+ return generateCustomEventNode2(ctx, id, current);
2887
+ }
2888
+ if (typeof DOMException !== "undefined" && currentClass === DOMException) {
2889
+ return createDOMExceptionNode(id, current);
2881
2890
  }
2882
2891
  }
2883
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
2892
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
2884
2893
  return generateAggregateErrorNode2(ctx, id, current);
2885
2894
  }
2886
2895
  if (current instanceof Error) {
@@ -3646,40 +3655,47 @@ async function parseObject3(ctx, current) {
3646
3655
  current
3647
3656
  );
3648
3657
  }
3658
+ if (ctx.features & 256 /* Promise */ && (currentClass === Promise || current instanceof Promise)) {
3659
+ return generatePromiseNode2(ctx, id, current);
3660
+ }
3649
3661
  if (ctx.features & 8192 /* WebAPI */) {
3650
- switch (currentClass) {
3651
- case URL:
3652
- return createURLNode(id, current);
3653
- case URLSearchParams:
3654
- return createURLSearchParamsNode(id, current);
3655
- case Blob:
3656
- return createBlobNode2(ctx, id, current);
3657
- case File:
3658
- return createFileNode2(ctx, id, current);
3659
- case Headers:
3660
- return generateHeadersNode3(ctx, id, current);
3661
- case FormData:
3662
- return generateFormDataNode3(ctx, id, current);
3663
- case Request:
3664
- return generateRequestNode2(ctx, id, current);
3665
- case Response:
3666
- return generateResponseNode2(ctx, id, current);
3667
- case Event:
3668
- return generateEventNode3(ctx, id, current);
3669
- case CustomEvent:
3670
- return generateCustomEventNode3(ctx, id, current);
3671
- case DOMException:
3672
- return createDOMExceptionNode(id, current);
3673
- default:
3674
- break;
3662
+ if (typeof URL !== "undefined" && currentClass === URL) {
3663
+ return createURLNode(id, current);
3664
+ }
3665
+ if (typeof URLSearchParams !== "undefined" && currentClass === URLSearchParams) {
3666
+ return createURLSearchParamsNode(id, current);
3667
+ }
3668
+ if (typeof Blob !== "undefined" && currentClass === Blob) {
3669
+ return createBlobNode2(ctx, id, current);
3670
+ }
3671
+ if (typeof File !== "undefined" && currentClass === File) {
3672
+ return createFileNode2(ctx, id, current);
3673
+ }
3674
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
3675
+ return generateHeadersNode3(ctx, id, current);
3676
+ }
3677
+ if (typeof FormData !== "undefined" && currentClass === FormData) {
3678
+ return generateFormDataNode3(ctx, id, current);
3679
+ }
3680
+ if (typeof Request !== "undefined" && currentClass === Request) {
3681
+ return generateRequestNode2(ctx, id, current);
3682
+ }
3683
+ if (typeof Response !== "undefined" && currentClass === Response) {
3684
+ return generateResponseNode2(ctx, id, current);
3685
+ }
3686
+ if (typeof Event !== "undefined" && currentClass === Event) {
3687
+ return generateEventNode3(ctx, id, current);
3688
+ }
3689
+ if (typeof CustomEvent !== "undefined" && currentClass === CustomEvent) {
3690
+ return generateCustomEventNode3(ctx, id, current);
3691
+ }
3692
+ if (typeof DOMException !== "undefined" && currentClass === DOMException) {
3693
+ return createDOMExceptionNode(id, current);
3675
3694
  }
3676
3695
  }
3677
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
3696
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
3678
3697
  return generateAggregateErrorNode3(ctx, id, current);
3679
3698
  }
3680
- if (ctx.features & 256 /* Promise */ && (currentClass === Promise || current instanceof Promise)) {
3681
- return generatePromiseNode2(ctx, id, current);
3682
- }
3683
3699
  if (current instanceof Error) {
3684
3700
  return generateErrorNode3(ctx, id, current);
3685
3701
  }
@@ -4884,38 +4900,44 @@ function parseObject4(ctx, current) {
4884
4900
  if (ctx.features & 512 /* Set */ && currentClass === Set) {
4885
4901
  return generateSetNode4(ctx, id, current);
4886
4902
  }
4903
+ if (ctx.features & 256 /* Promise */ && (currentClass === Promise || current instanceof Promise)) {
4904
+ return generatePromiseNode3(ctx, id, current);
4905
+ }
4887
4906
  if (ctx.features & 8192 /* WebAPI */) {
4888
- switch (currentClass) {
4889
- case URL:
4890
- return createURLNode(id, current);
4891
- case URLSearchParams:
4892
- return createURLSearchParamsNode(id, current);
4893
- case Headers:
4894
- return generateHeadersNode4(ctx, id, current);
4895
- case FormData:
4896
- return generateFormDataNode4(ctx, id, current);
4897
- case ReadableStream:
4898
- return generateReadableStreamNode(ctx, id, current);
4899
- case Request:
4900
- return generateRequestNode3(ctx, id, current);
4901
- case Response:
4902
- return generateResponseNode3(ctx, id, current);
4903
- case Event:
4904
- return generateEventNode4(ctx, id, current);
4905
- case CustomEvent:
4906
- return generateCustomEventNode4(ctx, id, current);
4907
- case DOMException:
4908
- return createDOMExceptionNode(id, current);
4909
- default:
4910
- break;
4907
+ if (typeof URL !== "undefined" && currentClass === URL) {
4908
+ return createURLNode(id, current);
4909
+ }
4910
+ if (typeof URLSearchParams !== "undefined" && currentClass === URLSearchParams) {
4911
+ return createURLSearchParamsNode(id, current);
4912
+ }
4913
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
4914
+ return generateHeadersNode4(ctx, id, current);
4915
+ }
4916
+ if (typeof FormData !== "undefined" && currentClass === FormData) {
4917
+ return generateFormDataNode4(ctx, id, current);
4918
+ }
4919
+ if (typeof ReadableStream !== "undefined" && currentClass === ReadableStream) {
4920
+ return generateReadableStreamNode(ctx, id, current);
4921
+ }
4922
+ if (typeof Request !== "undefined" && currentClass === Request) {
4923
+ return generateRequestNode3(ctx, id, current);
4924
+ }
4925
+ if (typeof Response !== "undefined" && currentClass === Response) {
4926
+ return generateResponseNode3(ctx, id, current);
4927
+ }
4928
+ if (typeof Event !== "undefined" && currentClass === Event) {
4929
+ return generateEventNode4(ctx, id, current);
4930
+ }
4931
+ if (typeof CustomEvent !== "undefined" && currentClass === CustomEvent) {
4932
+ return generateCustomEventNode4(ctx, id, current);
4933
+ }
4934
+ if (typeof DOMException !== "undefined" && currentClass === DOMException) {
4935
+ return createDOMExceptionNode(id, current);
4911
4936
  }
4912
4937
  }
4913
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
4938
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
4914
4939
  return generateAggregateErrorNode4(ctx, id, current);
4915
4940
  }
4916
- if (ctx.features & 256 /* Promise */ && (currentClass === Promise || current instanceof Promise)) {
4917
- return generatePromiseNode3(ctx, id, current);
4918
- }
4919
4941
  if (current instanceof Error) {
4920
4942
  return generateErrorNode4(ctx, id, current);
4921
4943
  }
@@ -5361,26 +5383,29 @@ function parseObject5(ctx, current) {
5361
5383
  return generateSetNode5(ctx, id, current);
5362
5384
  }
5363
5385
  if (ctx.features & 8192 /* WebAPI */) {
5364
- switch (currentClass) {
5365
- case URL:
5366
- return createURLNode(id, current);
5367
- case URLSearchParams:
5368
- return createURLSearchParamsNode(id, current);
5369
- case Headers:
5370
- return generateHeadersNode5(ctx, id, current);
5371
- case FormData:
5372
- return generateFormDataNode5(ctx, id, current);
5373
- case Event:
5374
- return generateEventNode5(ctx, id, current);
5375
- case CustomEvent:
5376
- return generateCustomEventNode5(ctx, id, current);
5377
- case DOMException:
5378
- return createDOMExceptionNode(id, current);
5379
- default:
5380
- break;
5386
+ if (typeof URL !== "undefined" && currentClass === URL) {
5387
+ return createURLNode(id, current);
5388
+ }
5389
+ if (typeof URLSearchParams !== "undefined" && currentClass === URLSearchParams) {
5390
+ return createURLSearchParamsNode(id, current);
5391
+ }
5392
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
5393
+ return generateHeadersNode5(ctx, id, current);
5394
+ }
5395
+ if (typeof FormData !== "undefined" && currentClass === FormData) {
5396
+ return generateFormDataNode5(ctx, id, current);
5397
+ }
5398
+ if (typeof Event !== "undefined" && currentClass === Event) {
5399
+ return generateEventNode5(ctx, id, current);
5400
+ }
5401
+ if (typeof CustomEvent !== "undefined" && currentClass === CustomEvent) {
5402
+ return generateCustomEventNode5(ctx, id, current);
5403
+ }
5404
+ if (typeof DOMException !== "undefined" && currentClass === DOMException) {
5405
+ return createDOMExceptionNode(id, current);
5381
5406
  }
5382
5407
  }
5383
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
5408
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
5384
5409
  return generateAggregateErrorNode5(ctx, id, current);
5385
5410
  }
5386
5411
  if (current instanceof Error) {