seroval 0.11.5 → 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 */) {
@@ -1372,34 +1371,41 @@ async function parseObject(ctx, current) {
1372
1371
  return generatePromiseNode(ctx, id, current);
1373
1372
  }
1374
1373
  if (ctx.features & 8192 /* WebAPI */) {
1375
- switch (currentClass) {
1376
- case URL:
1377
- return createURLNode(id, current);
1378
- case URLSearchParams:
1379
- return createURLSearchParamsNode(id, current);
1380
- case Blob:
1381
- return createBlobNode(ctx, id, current);
1382
- case File:
1383
- return createFileNode(ctx, id, current);
1384
- case Headers:
1385
- return generateHeadersNode(ctx, id, current);
1386
- case FormData:
1387
- return generateFormDataNode(ctx, id, current);
1388
- case Request:
1389
- return generateRequestNode(ctx, id, current);
1390
- case Response:
1391
- return generateResponseNode(ctx, id, current);
1392
- case Event:
1393
- return generateEventNode(ctx, id, current);
1394
- case CustomEvent:
1395
- return generateCustomEventNode(ctx, id, current);
1396
- case DOMException:
1397
- return createDOMExceptionNode(id, current);
1398
- default:
1399
- 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);
1400
1406
  }
1401
1407
  }
1402
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
1408
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
1403
1409
  return generateAggregateErrorNode(ctx, id, current);
1404
1410
  }
1405
1411
  if (current instanceof Error) {
@@ -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) {
@@ -3650,34 +3659,41 @@ async function parseObject3(ctx, current) {
3650
3659
  return generatePromiseNode2(ctx, id, current);
3651
3660
  }
3652
3661
  if (ctx.features & 8192 /* WebAPI */) {
3653
- switch (currentClass) {
3654
- case URL:
3655
- return createURLNode(id, current);
3656
- case URLSearchParams:
3657
- return createURLSearchParamsNode(id, current);
3658
- case Blob:
3659
- return createBlobNode2(ctx, id, current);
3660
- case File:
3661
- return createFileNode2(ctx, id, current);
3662
- case Headers:
3663
- return generateHeadersNode3(ctx, id, current);
3664
- case FormData:
3665
- return generateFormDataNode3(ctx, id, current);
3666
- case Request:
3667
- return generateRequestNode2(ctx, id, current);
3668
- case Response:
3669
- return generateResponseNode2(ctx, id, current);
3670
- case Event:
3671
- return generateEventNode3(ctx, id, current);
3672
- case CustomEvent:
3673
- return generateCustomEventNode3(ctx, id, current);
3674
- case DOMException:
3675
- return createDOMExceptionNode(id, current);
3676
- default:
3677
- 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);
3678
3694
  }
3679
3695
  }
3680
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
3696
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
3681
3697
  return generateAggregateErrorNode3(ctx, id, current);
3682
3698
  }
3683
3699
  if (current instanceof Error) {
@@ -4888,32 +4904,38 @@ function parseObject4(ctx, current) {
4888
4904
  return generatePromiseNode3(ctx, id, current);
4889
4905
  }
4890
4906
  if (ctx.features & 8192 /* WebAPI */) {
4891
- switch (currentClass) {
4892
- case URL:
4893
- return createURLNode(id, current);
4894
- case URLSearchParams:
4895
- return createURLSearchParamsNode(id, current);
4896
- case Headers:
4897
- return generateHeadersNode4(ctx, id, current);
4898
- case FormData:
4899
- return generateFormDataNode4(ctx, id, current);
4900
- case ReadableStream:
4901
- return generateReadableStreamNode(ctx, id, current);
4902
- case Request:
4903
- return generateRequestNode3(ctx, id, current);
4904
- case Response:
4905
- return generateResponseNode3(ctx, id, current);
4906
- case Event:
4907
- return generateEventNode4(ctx, id, current);
4908
- case CustomEvent:
4909
- return generateCustomEventNode4(ctx, id, current);
4910
- case DOMException:
4911
- return createDOMExceptionNode(id, current);
4912
- default:
4913
- 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);
4914
4936
  }
4915
4937
  }
4916
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
4938
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
4917
4939
  return generateAggregateErrorNode4(ctx, id, current);
4918
4940
  }
4919
4941
  if (current instanceof Error) {
@@ -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) {