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.
@@ -740,12 +740,11 @@ function isIterable(ctx, value) {
740
740
  return false;
741
741
  }
742
742
  if (ctx.features & 8192 /* WebAPI */) {
743
- switch (currentClass) {
744
- case Headers:
745
- case File:
746
- return false;
747
- default:
748
- break;
743
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
744
+ return false;
745
+ }
746
+ if (typeof File !== "undefined" && currentClass === File) {
747
+ return false;
749
748
  }
750
749
  }
751
750
  if (ctx.features & 1024 /* Symbol */) {
@@ -1411,34 +1410,41 @@ async function parseObject(ctx, current) {
1411
1410
  return generatePromiseNode(ctx, id, current);
1412
1411
  }
1413
1412
  if (ctx.features & 8192 /* WebAPI */) {
1414
- switch (currentClass) {
1415
- case URL:
1416
- return createURLNode(id, current);
1417
- case URLSearchParams:
1418
- return createURLSearchParamsNode(id, current);
1419
- case Blob:
1420
- return createBlobNode(ctx, id, current);
1421
- case File:
1422
- return createFileNode(ctx, id, current);
1423
- case Headers:
1424
- return generateHeadersNode(ctx, id, current);
1425
- case FormData:
1426
- return generateFormDataNode(ctx, id, current);
1427
- case Request:
1428
- return generateRequestNode(ctx, id, current);
1429
- case Response:
1430
- return generateResponseNode(ctx, id, current);
1431
- case Event:
1432
- return generateEventNode(ctx, id, current);
1433
- case CustomEvent:
1434
- return generateCustomEventNode(ctx, id, current);
1435
- case DOMException:
1436
- return createDOMExceptionNode(id, current);
1437
- default:
1438
- break;
1413
+ if (typeof URL !== "undefined" && currentClass === URL) {
1414
+ return createURLNode(id, current);
1415
+ }
1416
+ if (typeof URLSearchParams !== "undefined" && currentClass === URLSearchParams) {
1417
+ return createURLSearchParamsNode(id, current);
1418
+ }
1419
+ if (typeof Blob !== "undefined" && currentClass === Blob) {
1420
+ return createBlobNode(ctx, id, current);
1421
+ }
1422
+ if (typeof File !== "undefined" && currentClass === File) {
1423
+ return createFileNode(ctx, id, current);
1424
+ }
1425
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
1426
+ return generateHeadersNode(ctx, id, current);
1427
+ }
1428
+ if (typeof FormData !== "undefined" && currentClass === FormData) {
1429
+ return generateFormDataNode(ctx, id, current);
1430
+ }
1431
+ if (typeof Request !== "undefined" && currentClass === Request) {
1432
+ return generateRequestNode(ctx, id, current);
1433
+ }
1434
+ if (typeof Response !== "undefined" && currentClass === Response) {
1435
+ return generateResponseNode(ctx, id, current);
1436
+ }
1437
+ if (typeof Event !== "undefined" && currentClass === Event) {
1438
+ return generateEventNode(ctx, id, current);
1439
+ }
1440
+ if (typeof CustomEvent !== "undefined" && currentClass === CustomEvent) {
1441
+ return generateCustomEventNode(ctx, id, current);
1442
+ }
1443
+ if (typeof DOMException !== "undefined" && currentClass === DOMException) {
1444
+ return createDOMExceptionNode(id, current);
1439
1445
  }
1440
1446
  }
1441
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
1447
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
1442
1448
  return generateAggregateErrorNode(ctx, id, current);
1443
1449
  }
1444
1450
  if (current instanceof Error) {
@@ -2900,26 +2906,29 @@ function parseObject2(ctx, current) {
2900
2906
  return generateSetNode2(ctx, id, current);
2901
2907
  }
2902
2908
  if (ctx.features & 8192 /* WebAPI */) {
2903
- switch (currentClass) {
2904
- case URL:
2905
- return createURLNode(id, current);
2906
- case URLSearchParams:
2907
- return createURLSearchParamsNode(id, current);
2908
- case Headers:
2909
- return generateHeadersNode2(ctx, id, current);
2910
- case FormData:
2911
- return generateFormDataNode2(ctx, id, current);
2912
- case Event:
2913
- return generateEventNode2(ctx, id, current);
2914
- case CustomEvent:
2915
- return generateCustomEventNode2(ctx, id, current);
2916
- case DOMException:
2917
- return createDOMExceptionNode(id, current);
2918
- default:
2919
- break;
2909
+ if (typeof URL !== "undefined" && currentClass === URL) {
2910
+ return createURLNode(id, current);
2911
+ }
2912
+ if (typeof URLSearchParams !== "undefined" && currentClass === URLSearchParams) {
2913
+ return createURLSearchParamsNode(id, current);
2914
+ }
2915
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
2916
+ return generateHeadersNode2(ctx, id, current);
2917
+ }
2918
+ if (typeof FormData !== "undefined" && currentClass === FormData) {
2919
+ return generateFormDataNode2(ctx, id, current);
2920
+ }
2921
+ if (typeof Event !== "undefined" && currentClass === Event) {
2922
+ return generateEventNode2(ctx, id, current);
2923
+ }
2924
+ if (typeof CustomEvent !== "undefined" && currentClass === CustomEvent) {
2925
+ return generateCustomEventNode2(ctx, id, current);
2926
+ }
2927
+ if (typeof DOMException !== "undefined" && currentClass === DOMException) {
2928
+ return createDOMExceptionNode(id, current);
2920
2929
  }
2921
2930
  }
2922
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
2931
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
2923
2932
  return generateAggregateErrorNode2(ctx, id, current);
2924
2933
  }
2925
2934
  if (current instanceof Error) {
@@ -3689,34 +3698,41 @@ async function parseObject3(ctx, current) {
3689
3698
  return generatePromiseNode2(ctx, id, current);
3690
3699
  }
3691
3700
  if (ctx.features & 8192 /* WebAPI */) {
3692
- switch (currentClass) {
3693
- case URL:
3694
- return createURLNode(id, current);
3695
- case URLSearchParams:
3696
- return createURLSearchParamsNode(id, current);
3697
- case Blob:
3698
- return createBlobNode2(ctx, id, current);
3699
- case File:
3700
- return createFileNode2(ctx, id, current);
3701
- case Headers:
3702
- return generateHeadersNode3(ctx, id, current);
3703
- case FormData:
3704
- return generateFormDataNode3(ctx, id, current);
3705
- case Request:
3706
- return generateRequestNode2(ctx, id, current);
3707
- case Response:
3708
- return generateResponseNode2(ctx, id, current);
3709
- case Event:
3710
- return generateEventNode3(ctx, id, current);
3711
- case CustomEvent:
3712
- return generateCustomEventNode3(ctx, id, current);
3713
- case DOMException:
3714
- return createDOMExceptionNode(id, current);
3715
- default:
3716
- break;
3701
+ if (typeof URL !== "undefined" && currentClass === URL) {
3702
+ return createURLNode(id, current);
3703
+ }
3704
+ if (typeof URLSearchParams !== "undefined" && currentClass === URLSearchParams) {
3705
+ return createURLSearchParamsNode(id, current);
3706
+ }
3707
+ if (typeof Blob !== "undefined" && currentClass === Blob) {
3708
+ return createBlobNode2(ctx, id, current);
3709
+ }
3710
+ if (typeof File !== "undefined" && currentClass === File) {
3711
+ return createFileNode2(ctx, id, current);
3712
+ }
3713
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
3714
+ return generateHeadersNode3(ctx, id, current);
3715
+ }
3716
+ if (typeof FormData !== "undefined" && currentClass === FormData) {
3717
+ return generateFormDataNode3(ctx, id, current);
3718
+ }
3719
+ if (typeof Request !== "undefined" && currentClass === Request) {
3720
+ return generateRequestNode2(ctx, id, current);
3721
+ }
3722
+ if (typeof Response !== "undefined" && currentClass === Response) {
3723
+ return generateResponseNode2(ctx, id, current);
3724
+ }
3725
+ if (typeof Event !== "undefined" && currentClass === Event) {
3726
+ return generateEventNode3(ctx, id, current);
3727
+ }
3728
+ if (typeof CustomEvent !== "undefined" && currentClass === CustomEvent) {
3729
+ return generateCustomEventNode3(ctx, id, current);
3730
+ }
3731
+ if (typeof DOMException !== "undefined" && currentClass === DOMException) {
3732
+ return createDOMExceptionNode(id, current);
3717
3733
  }
3718
3734
  }
3719
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
3735
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
3720
3736
  return generateAggregateErrorNode3(ctx, id, current);
3721
3737
  }
3722
3738
  if (current instanceof Error) {
@@ -4927,32 +4943,38 @@ function parseObject4(ctx, current) {
4927
4943
  return generatePromiseNode3(ctx, id, current);
4928
4944
  }
4929
4945
  if (ctx.features & 8192 /* WebAPI */) {
4930
- switch (currentClass) {
4931
- case URL:
4932
- return createURLNode(id, current);
4933
- case URLSearchParams:
4934
- return createURLSearchParamsNode(id, current);
4935
- case Headers:
4936
- return generateHeadersNode4(ctx, id, current);
4937
- case FormData:
4938
- return generateFormDataNode4(ctx, id, current);
4939
- case ReadableStream:
4940
- return generateReadableStreamNode(ctx, id, current);
4941
- case Request:
4942
- return generateRequestNode3(ctx, id, current);
4943
- case Response:
4944
- return generateResponseNode3(ctx, id, current);
4945
- case Event:
4946
- return generateEventNode4(ctx, id, current);
4947
- case CustomEvent:
4948
- return generateCustomEventNode4(ctx, id, current);
4949
- case DOMException:
4950
- return createDOMExceptionNode(id, current);
4951
- default:
4952
- break;
4946
+ if (typeof URL !== "undefined" && currentClass === URL) {
4947
+ return createURLNode(id, current);
4948
+ }
4949
+ if (typeof URLSearchParams !== "undefined" && currentClass === URLSearchParams) {
4950
+ return createURLSearchParamsNode(id, current);
4951
+ }
4952
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
4953
+ return generateHeadersNode4(ctx, id, current);
4954
+ }
4955
+ if (typeof FormData !== "undefined" && currentClass === FormData) {
4956
+ return generateFormDataNode4(ctx, id, current);
4957
+ }
4958
+ if (typeof ReadableStream !== "undefined" && currentClass === ReadableStream) {
4959
+ return generateReadableStreamNode(ctx, id, current);
4960
+ }
4961
+ if (typeof Request !== "undefined" && currentClass === Request) {
4962
+ return generateRequestNode3(ctx, id, current);
4963
+ }
4964
+ if (typeof Response !== "undefined" && currentClass === Response) {
4965
+ return generateResponseNode3(ctx, id, current);
4966
+ }
4967
+ if (typeof Event !== "undefined" && currentClass === Event) {
4968
+ return generateEventNode4(ctx, id, current);
4969
+ }
4970
+ if (typeof CustomEvent !== "undefined" && currentClass === CustomEvent) {
4971
+ return generateCustomEventNode4(ctx, id, current);
4972
+ }
4973
+ if (typeof DOMException !== "undefined" && currentClass === DOMException) {
4974
+ return createDOMExceptionNode(id, current);
4953
4975
  }
4954
4976
  }
4955
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
4977
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
4956
4978
  return generateAggregateErrorNode4(ctx, id, current);
4957
4979
  }
4958
4980
  if (current instanceof Error) {
@@ -5400,26 +5422,29 @@ function parseObject5(ctx, current) {
5400
5422
  return generateSetNode5(ctx, id, current);
5401
5423
  }
5402
5424
  if (ctx.features & 8192 /* WebAPI */) {
5403
- switch (currentClass) {
5404
- case URL:
5405
- return createURLNode(id, current);
5406
- case URLSearchParams:
5407
- return createURLSearchParamsNode(id, current);
5408
- case Headers:
5409
- return generateHeadersNode5(ctx, id, current);
5410
- case FormData:
5411
- return generateFormDataNode5(ctx, id, current);
5412
- case Event:
5413
- return generateEventNode5(ctx, id, current);
5414
- case CustomEvent:
5415
- return generateCustomEventNode5(ctx, id, current);
5416
- case DOMException:
5417
- return createDOMExceptionNode(id, current);
5418
- default:
5419
- break;
5425
+ if (typeof URL !== "undefined" && currentClass === URL) {
5426
+ return createURLNode(id, current);
5427
+ }
5428
+ if (typeof URLSearchParams !== "undefined" && currentClass === URLSearchParams) {
5429
+ return createURLSearchParamsNode(id, current);
5430
+ }
5431
+ if (typeof Headers !== "undefined" && currentClass === Headers) {
5432
+ return generateHeadersNode5(ctx, id, current);
5433
+ }
5434
+ if (typeof FormData !== "undefined" && currentClass === FormData) {
5435
+ return generateFormDataNode5(ctx, id, current);
5436
+ }
5437
+ if (typeof Event !== "undefined" && currentClass === Event) {
5438
+ return generateEventNode5(ctx, id, current);
5439
+ }
5440
+ if (typeof CustomEvent !== "undefined" && currentClass === CustomEvent) {
5441
+ return generateCustomEventNode5(ctx, id, current);
5442
+ }
5443
+ if (typeof DOMException !== "undefined" && currentClass === DOMException) {
5444
+ return createDOMExceptionNode(id, current);
5420
5445
  }
5421
5446
  }
5422
- if (ctx.features & 1 /* AggregateError */ && (currentClass === AggregateError || current instanceof AggregateError)) {
5447
+ if (ctx.features & 1 /* AggregateError */ && typeof AggregateError !== "undefined" && (currentClass === AggregateError || current instanceof AggregateError)) {
5423
5448
  return generateAggregateErrorNode5(ctx, id, current);
5424
5449
  }
5425
5450
  if (current instanceof Error) {