seroval 0.11.0 → 0.11.1
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 +9 -16
- package/dist/cjs/development/index.cjs.map +2 -2
- package/dist/cjs/production/index.cjs +3 -3
- package/dist/esm/development/index.mjs +9 -16
- package/dist/esm/development/index.mjs.map +2 -2
- package/dist/esm/production/index.mjs +3 -3
- package/dist/types/core/base-primitives.d.ts +2 -3
- package/package.json +3 -3
- package/src/core/base-primitives.ts +0 -7
- package/src/core/cross/async.ts +1 -1
- package/src/core/cross/primitives.ts +1 -2
- package/src/core/cross/stream.ts +1 -1
- package/src/core/cross/sync.ts +1 -1
- package/src/core/cross/web-api.ts +0 -5
- package/src/core/tree/async.ts +1 -1
- package/src/core/tree/primitives.ts +1 -1
- package/src/core/tree/sync.ts +1 -1
- package/src/core/tree/web-api.ts +0 -5
- package/src/core/header.js +0 -61
|
@@ -439,8 +439,7 @@ function createStringNode(value) {
|
|
|
439
439
|
o: void 0
|
|
440
440
|
};
|
|
441
441
|
}
|
|
442
|
-
function createBigIntNode(
|
|
443
|
-
assert(ctx.features & 8 /* BigInt */, new UnsupportedTypeError(current));
|
|
442
|
+
function createBigIntNode(current) {
|
|
444
443
|
return {
|
|
445
444
|
t: 3 /* BigInt */,
|
|
446
445
|
i: void 0,
|
|
@@ -526,8 +525,7 @@ function createArrayBufferNode(id, current) {
|
|
|
526
525
|
o: void 0
|
|
527
526
|
};
|
|
528
527
|
}
|
|
529
|
-
function createWKSymbolNode(
|
|
530
|
-
assert(ctx.features & 1024 /* Symbol */, new UnsupportedTypeError(current));
|
|
528
|
+
function createWKSymbolNode(id, current) {
|
|
531
529
|
assert(current in INV_SYMBOL_REF, new Error("Only well-known symbols are supported."));
|
|
532
530
|
return {
|
|
533
531
|
t: 17 /* WKSymbol */,
|
|
@@ -625,7 +623,7 @@ function createSymbolNode(ctx, current) {
|
|
|
625
623
|
if (hasReferenceID(current)) {
|
|
626
624
|
return createReferenceNode(id, current);
|
|
627
625
|
}
|
|
628
|
-
return createWKSymbolNode(
|
|
626
|
+
return createWKSymbolNode(id, current);
|
|
629
627
|
}
|
|
630
628
|
function createFunctionNode(ctx, current) {
|
|
631
629
|
assert(hasReferenceID(current), new Error("Cannot serialize function without reference ID."));
|
|
@@ -777,7 +775,6 @@ function getObjectFlag(obj) {
|
|
|
777
775
|
|
|
778
776
|
// src/core/tree/web-api.ts
|
|
779
777
|
async function createBlobNode(ctx, id, current) {
|
|
780
|
-
assert(ctx.features & 8192 /* WebAPI */, new UnsupportedTypeError(current));
|
|
781
778
|
return {
|
|
782
779
|
t: 23 /* Blob */,
|
|
783
780
|
i: id,
|
|
@@ -794,7 +791,6 @@ async function createBlobNode(ctx, id, current) {
|
|
|
794
791
|
};
|
|
795
792
|
}
|
|
796
793
|
async function createFileNode(ctx, id, current) {
|
|
797
|
-
assert(ctx.features & 8192 /* WebAPI */, new UnsupportedTypeError(current));
|
|
798
794
|
return {
|
|
799
795
|
t: 24 /* File */,
|
|
800
796
|
i: id,
|
|
@@ -1430,7 +1426,7 @@ async function parseObject(ctx, current) {
|
|
|
1430
1426
|
async function parseAsync(ctx, current) {
|
|
1431
1427
|
const t = typeof current;
|
|
1432
1428
|
if (ctx.features & 8 /* BigInt */ && t === "bigint") {
|
|
1433
|
-
return createBigIntNode(
|
|
1429
|
+
return createBigIntNode(current);
|
|
1434
1430
|
}
|
|
1435
1431
|
switch (t) {
|
|
1436
1432
|
case "boolean":
|
|
@@ -2911,7 +2907,7 @@ function parseObject2(ctx, current) {
|
|
|
2911
2907
|
function parseSync(ctx, current) {
|
|
2912
2908
|
const t = typeof current;
|
|
2913
2909
|
if (ctx.features & 8 /* BigInt */ && t === "bigint") {
|
|
2914
|
-
return createBigIntNode(
|
|
2910
|
+
return createBigIntNode(current);
|
|
2915
2911
|
}
|
|
2916
2912
|
switch (t) {
|
|
2917
2913
|
case "boolean":
|
|
@@ -3081,7 +3077,6 @@ function serializeArrayBuffer3(ctx, current) {
|
|
|
3081
3077
|
return createArrayBufferNode(newID, current);
|
|
3082
3078
|
}
|
|
3083
3079
|
function createTypedArrayNode2(ctx, id, current) {
|
|
3084
|
-
assert(ctx.features & 2048 /* TypedArray */, new UnsupportedTypeError(current));
|
|
3085
3080
|
return {
|
|
3086
3081
|
t: 15 /* TypedArray */,
|
|
3087
3082
|
i: id,
|
|
@@ -3144,7 +3139,7 @@ function createSymbolNode2(ctx, current) {
|
|
|
3144
3139
|
if (hasReferenceID(current)) {
|
|
3145
3140
|
return createReferenceNode(newID, current);
|
|
3146
3141
|
}
|
|
3147
|
-
return createWKSymbolNode(
|
|
3142
|
+
return createWKSymbolNode(newID, current);
|
|
3148
3143
|
}
|
|
3149
3144
|
function createFunctionNode2(ctx, current) {
|
|
3150
3145
|
assert(hasReferenceID(current), new Error("Cannot serialize function without reference ID."));
|
|
@@ -3159,7 +3154,6 @@ function createFunctionNode2(ctx, current) {
|
|
|
3159
3154
|
|
|
3160
3155
|
// src/core/cross/web-api.ts
|
|
3161
3156
|
async function createBlobNode2(ctx, id, current) {
|
|
3162
|
-
assert(ctx.features & 8192 /* WebAPI */, new UnsupportedTypeError(current));
|
|
3163
3157
|
return {
|
|
3164
3158
|
t: 23 /* Blob */,
|
|
3165
3159
|
i: id,
|
|
@@ -3176,7 +3170,6 @@ async function createBlobNode2(ctx, id, current) {
|
|
|
3176
3170
|
};
|
|
3177
3171
|
}
|
|
3178
3172
|
async function createFileNode2(ctx, id, current) {
|
|
3179
|
-
assert(ctx.features & 8192 /* WebAPI */, new UnsupportedTypeError(current));
|
|
3180
3173
|
return {
|
|
3181
3174
|
t: 24 /* File */,
|
|
3182
3175
|
i: id,
|
|
@@ -3716,7 +3709,7 @@ async function parseObject3(ctx, current) {
|
|
|
3716
3709
|
async function crossParseAsync(ctx, current) {
|
|
3717
3710
|
const t = typeof current;
|
|
3718
3711
|
if (ctx.features & 8 /* BigInt */ && t === "bigint") {
|
|
3719
|
-
return createBigIntNode(
|
|
3712
|
+
return createBigIntNode(current);
|
|
3720
3713
|
}
|
|
3721
3714
|
switch (t) {
|
|
3722
3715
|
case "boolean":
|
|
@@ -4953,7 +4946,7 @@ function parseObject4(ctx, current) {
|
|
|
4953
4946
|
function crossParseStream(ctx, current) {
|
|
4954
4947
|
const t = typeof current;
|
|
4955
4948
|
if (ctx.features & 8 /* BigInt */ && t === "bigint") {
|
|
4956
|
-
return createBigIntNode(
|
|
4949
|
+
return createBigIntNode(current);
|
|
4957
4950
|
}
|
|
4958
4951
|
switch (t) {
|
|
4959
4952
|
case "boolean":
|
|
@@ -5420,7 +5413,7 @@ function parseObject5(ctx, current) {
|
|
|
5420
5413
|
function crossParseSync(ctx, current) {
|
|
5421
5414
|
const t = typeof current;
|
|
5422
5415
|
if (ctx.features & 8 /* BigInt */ && t === "bigint") {
|
|
5423
|
-
return createBigIntNode(
|
|
5416
|
+
return createBigIntNode(current);
|
|
5424
5417
|
}
|
|
5425
5418
|
switch (t) {
|
|
5426
5419
|
case "boolean":
|