seroval 1.6.4 → 1.6.5
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/dev/index.cjs +6 -2
- package/dist/dev/index.d.cts +2 -1
- package/dist/dev/index.d.ts +2 -1
- package/dist/dev/index.js +6 -3
- package/dist/index.cjs +6 -2
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +6 -3
- package/package.json +1 -1
package/dist/dev/index.cjs
CHANGED
|
@@ -1452,13 +1452,15 @@ function deserializePromiseFulfill(ctx, depth, node) {
|
|
|
1452
1452
|
function deserializeIteratorFactoryInstance(ctx, depth, node) {
|
|
1453
1453
|
deserialize$1(ctx, depth, node.a[0]);
|
|
1454
1454
|
const source = deserialize$1(ctx, depth, node.a[1]);
|
|
1455
|
-
|
|
1455
|
+
validateNodeType(ctx, node, node.a[1].i, 35);
|
|
1456
|
+
if (!source) throw new SerovalMalformedNodeError(node.a[1]);
|
|
1456
1457
|
return sequenceToIterator(source);
|
|
1457
1458
|
}
|
|
1458
1459
|
function deserializeAsyncIteratorFactoryInstance(ctx, depth, node) {
|
|
1459
1460
|
deserialize$1(ctx, depth, node.a[0]);
|
|
1460
1461
|
const source = deserialize$1(ctx, depth, node.a[1]);
|
|
1461
|
-
|
|
1462
|
+
validateNodeType(ctx, node, node.a[1].i, 31);
|
|
1463
|
+
if (!source) throw new SerovalMalformedNodeError(node.a[1]);
|
|
1462
1464
|
return streamToAsyncIterable(source);
|
|
1463
1465
|
}
|
|
1464
1466
|
function deserializeStreamConstructor(ctx, depth, node) {
|
|
@@ -1504,6 +1506,7 @@ function deserializeAsyncIteratorFactory(ctx, depth, node) {
|
|
|
1504
1506
|
}
|
|
1505
1507
|
function deserializeSequence(ctx, depth, node) {
|
|
1506
1508
|
const result = assignIndexedValue$1(ctx, node.i, createSequence([], node.s, node.l));
|
|
1509
|
+
assignNodeType(ctx, node.i, 35);
|
|
1507
1510
|
for (let i = 0, len = node.a.length; i < len; i++) result.v[i] = deserialize$1(ctx, depth, node.a[i]);
|
|
1508
1511
|
return result;
|
|
1509
1512
|
}
|
|
@@ -2949,6 +2952,7 @@ exports.deserialize = deserialize;
|
|
|
2949
2952
|
exports.fromCrossJSON = fromCrossJSON;
|
|
2950
2953
|
exports.fromJSON = fromJSON;
|
|
2951
2954
|
exports.getCrossReferenceHeader = getCrossReferenceHeader;
|
|
2955
|
+
exports.isStream = isStream;
|
|
2952
2956
|
exports.resolvePlugins = resolvePlugins;
|
|
2953
2957
|
exports.serialize = serialize;
|
|
2954
2958
|
exports.serializeAsync = serializeAsync;
|
package/dist/dev/index.d.cts
CHANGED
|
@@ -737,6 +737,7 @@ interface Stream<T> {
|
|
|
737
737
|
throw(value: unknown): void;
|
|
738
738
|
return(value: T): void;
|
|
739
739
|
}
|
|
740
|
+
declare function isStream<T>(value: object): value is Stream<T>;
|
|
740
741
|
declare function createStream<T>(): Stream<T>;
|
|
741
742
|
//#endregion
|
|
742
743
|
//#region src/core/tree/index.d.ts
|
|
@@ -758,4 +759,4 @@ declare function toJSONAsync<T>(source: T, options?: AsyncParserContextOptions$1
|
|
|
758
759
|
declare function compileJSON(source: SerovalJSON, options?: PluginAccessOptions): string;
|
|
759
760
|
declare function fromJSON<T>(source: SerovalJSON, options?: FromJSONOptions): T;
|
|
760
761
|
//#endregion
|
|
761
|
-
export { type AsyncParsePluginContext, AsyncParserContextOptions, type BaseDeserializerContextOptions, type BaseParserContextOptions, type BaseSerializerContextOptions, type CrossContextOptions, type CrossDeserializerContextOptions, CrossSerializeAsyncOptions, CrossSerializeOptions, CrossSerializeStreamOptions, type CrossSerializerContextOptions, type DeserializePluginContext, Feature, FromCrossJSONOptions, FromJSONOptions, OpaqueReference, Plugin, PluginAccessOptions, PluginData, PluginInfo, type SerializePluginContext, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalJSON, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, type SerovalNode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, type Stream, type StreamListener, type StreamParsePluginContext, type StreamParserContextOptions, type SyncParsePluginContext, SyncParserContextOptions, ToCrossJSONAsyncOptions, ToCrossJSONOptions, ToCrossJSONStreamOptions, type VanillaDeserializerContextOptions, type VanillaSerializerContextOptions, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|
|
762
|
+
export { type AsyncParsePluginContext, AsyncParserContextOptions, type BaseDeserializerContextOptions, type BaseParserContextOptions, type BaseSerializerContextOptions, type CrossContextOptions, type CrossDeserializerContextOptions, CrossSerializeAsyncOptions, CrossSerializeOptions, CrossSerializeStreamOptions, type CrossSerializerContextOptions, type DeserializePluginContext, Feature, FromCrossJSONOptions, FromJSONOptions, OpaqueReference, Plugin, PluginAccessOptions, PluginData, PluginInfo, type SerializePluginContext, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalJSON, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, type SerovalNode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, type Stream, type StreamListener, type StreamParsePluginContext, type StreamParserContextOptions, type SyncParsePluginContext, SyncParserContextOptions, ToCrossJSONAsyncOptions, ToCrossJSONOptions, ToCrossJSONStreamOptions, type VanillaDeserializerContextOptions, type VanillaSerializerContextOptions, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, isStream, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|
package/dist/dev/index.d.ts
CHANGED
|
@@ -737,6 +737,7 @@ interface Stream<T> {
|
|
|
737
737
|
throw(value: unknown): void;
|
|
738
738
|
return(value: T): void;
|
|
739
739
|
}
|
|
740
|
+
declare function isStream<T>(value: object): value is Stream<T>;
|
|
740
741
|
declare function createStream<T>(): Stream<T>;
|
|
741
742
|
//#endregion
|
|
742
743
|
//#region src/core/tree/index.d.ts
|
|
@@ -758,4 +759,4 @@ declare function toJSONAsync<T>(source: T, options?: AsyncParserContextOptions$1
|
|
|
758
759
|
declare function compileJSON(source: SerovalJSON, options?: PluginAccessOptions): string;
|
|
759
760
|
declare function fromJSON<T>(source: SerovalJSON, options?: FromJSONOptions): T;
|
|
760
761
|
//#endregion
|
|
761
|
-
export { type AsyncParsePluginContext, AsyncParserContextOptions, type BaseDeserializerContextOptions, type BaseParserContextOptions, type BaseSerializerContextOptions, type CrossContextOptions, type CrossDeserializerContextOptions, CrossSerializeAsyncOptions, CrossSerializeOptions, CrossSerializeStreamOptions, type CrossSerializerContextOptions, type DeserializePluginContext, Feature, FromCrossJSONOptions, FromJSONOptions, OpaqueReference, Plugin, PluginAccessOptions, PluginData, PluginInfo, type SerializePluginContext, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalJSON, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, type SerovalNode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, type Stream, type StreamListener, type StreamParsePluginContext, type StreamParserContextOptions, type SyncParsePluginContext, SyncParserContextOptions, ToCrossJSONAsyncOptions, ToCrossJSONOptions, ToCrossJSONStreamOptions, type VanillaDeserializerContextOptions, type VanillaSerializerContextOptions, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|
|
762
|
+
export { type AsyncParsePluginContext, AsyncParserContextOptions, type BaseDeserializerContextOptions, type BaseParserContextOptions, type BaseSerializerContextOptions, type CrossContextOptions, type CrossDeserializerContextOptions, CrossSerializeAsyncOptions, CrossSerializeOptions, CrossSerializeStreamOptions, type CrossSerializerContextOptions, type DeserializePluginContext, Feature, FromCrossJSONOptions, FromJSONOptions, OpaqueReference, Plugin, PluginAccessOptions, PluginData, PluginInfo, type SerializePluginContext, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalJSON, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, type SerovalNode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, type Stream, type StreamListener, type StreamParsePluginContext, type StreamParserContextOptions, type SyncParsePluginContext, SyncParserContextOptions, ToCrossJSONAsyncOptions, ToCrossJSONOptions, ToCrossJSONStreamOptions, type VanillaDeserializerContextOptions, type VanillaSerializerContextOptions, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, isStream, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|
package/dist/dev/index.js
CHANGED
|
@@ -1451,13 +1451,15 @@ function deserializePromiseFulfill(ctx, depth, node) {
|
|
|
1451
1451
|
function deserializeIteratorFactoryInstance(ctx, depth, node) {
|
|
1452
1452
|
deserialize$1(ctx, depth, node.a[0]);
|
|
1453
1453
|
const source = deserialize$1(ctx, depth, node.a[1]);
|
|
1454
|
-
|
|
1454
|
+
validateNodeType(ctx, node, node.a[1].i, 35);
|
|
1455
|
+
if (!source) throw new SerovalMalformedNodeError(node.a[1]);
|
|
1455
1456
|
return sequenceToIterator(source);
|
|
1456
1457
|
}
|
|
1457
1458
|
function deserializeAsyncIteratorFactoryInstance(ctx, depth, node) {
|
|
1458
1459
|
deserialize$1(ctx, depth, node.a[0]);
|
|
1459
1460
|
const source = deserialize$1(ctx, depth, node.a[1]);
|
|
1460
|
-
|
|
1461
|
+
validateNodeType(ctx, node, node.a[1].i, 31);
|
|
1462
|
+
if (!source) throw new SerovalMalformedNodeError(node.a[1]);
|
|
1461
1463
|
return streamToAsyncIterable(source);
|
|
1462
1464
|
}
|
|
1463
1465
|
function deserializeStreamConstructor(ctx, depth, node) {
|
|
@@ -1503,6 +1505,7 @@ function deserializeAsyncIteratorFactory(ctx, depth, node) {
|
|
|
1503
1505
|
}
|
|
1504
1506
|
function deserializeSequence(ctx, depth, node) {
|
|
1505
1507
|
const result = assignIndexedValue$1(ctx, node.i, createSequence([], node.s, node.l));
|
|
1508
|
+
assignNodeType(ctx, node.i, 35);
|
|
1506
1509
|
for (let i = 0, len = node.a.length; i < len; i++) result.v[i] = deserialize$1(ctx, depth, node.a[i]);
|
|
1507
1510
|
return result;
|
|
1508
1511
|
}
|
|
@@ -2919,4 +2922,4 @@ function fromJSON(source, options = {}) {
|
|
|
2919
2922
|
}), source.t);
|
|
2920
2923
|
}
|
|
2921
2924
|
//#endregion
|
|
2922
|
-
export { Feature, OpaqueReference, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|
|
2925
|
+
export { Feature, OpaqueReference, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, isStream, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|
package/dist/index.cjs
CHANGED
|
@@ -1445,13 +1445,15 @@ function deserializePromiseFulfill(ctx, depth, node) {
|
|
|
1445
1445
|
function deserializeIteratorFactoryInstance(ctx, depth, node) {
|
|
1446
1446
|
deserialize$1(ctx, depth, node.a[0]);
|
|
1447
1447
|
const source = deserialize$1(ctx, depth, node.a[1]);
|
|
1448
|
-
|
|
1448
|
+
validateNodeType(ctx, node, node.a[1].i, 35);
|
|
1449
|
+
if (!source) throw new SerovalMalformedNodeError(node.a[1]);
|
|
1449
1450
|
return sequenceToIterator(source);
|
|
1450
1451
|
}
|
|
1451
1452
|
function deserializeAsyncIteratorFactoryInstance(ctx, depth, node) {
|
|
1452
1453
|
deserialize$1(ctx, depth, node.a[0]);
|
|
1453
1454
|
const source = deserialize$1(ctx, depth, node.a[1]);
|
|
1454
|
-
|
|
1455
|
+
validateNodeType(ctx, node, node.a[1].i, 31);
|
|
1456
|
+
if (!source) throw new SerovalMalformedNodeError(node.a[1]);
|
|
1455
1457
|
return streamToAsyncIterable(source);
|
|
1456
1458
|
}
|
|
1457
1459
|
function deserializeStreamConstructor(ctx, depth, node) {
|
|
@@ -1497,6 +1499,7 @@ function deserializeAsyncIteratorFactory(ctx, depth, node) {
|
|
|
1497
1499
|
}
|
|
1498
1500
|
function deserializeSequence(ctx, depth, node) {
|
|
1499
1501
|
const result = assignIndexedValue$1(ctx, node.i, createSequence([], node.s, node.l));
|
|
1502
|
+
assignNodeType(ctx, node.i, 35);
|
|
1500
1503
|
for (let i = 0, len = node.a.length; i < len; i++) result.v[i] = deserialize$1(ctx, depth, node.a[i]);
|
|
1501
1504
|
return result;
|
|
1502
1505
|
}
|
|
@@ -2942,6 +2945,7 @@ exports.deserialize = deserialize;
|
|
|
2942
2945
|
exports.fromCrossJSON = fromCrossJSON;
|
|
2943
2946
|
exports.fromJSON = fromJSON;
|
|
2944
2947
|
exports.getCrossReferenceHeader = getCrossReferenceHeader;
|
|
2948
|
+
exports.isStream = isStream;
|
|
2945
2949
|
exports.resolvePlugins = resolvePlugins;
|
|
2946
2950
|
exports.serialize = serialize;
|
|
2947
2951
|
exports.serializeAsync = serializeAsync;
|
package/dist/index.d.cts
CHANGED
|
@@ -737,6 +737,7 @@ interface Stream<T> {
|
|
|
737
737
|
throw(value: unknown): void;
|
|
738
738
|
return(value: T): void;
|
|
739
739
|
}
|
|
740
|
+
declare function isStream<T>(value: object): value is Stream<T>;
|
|
740
741
|
declare function createStream<T>(): Stream<T>;
|
|
741
742
|
//#endregion
|
|
742
743
|
//#region src/core/tree/index.d.ts
|
|
@@ -758,4 +759,4 @@ declare function toJSONAsync<T>(source: T, options?: AsyncParserContextOptions$1
|
|
|
758
759
|
declare function compileJSON(source: SerovalJSON, options?: PluginAccessOptions): string;
|
|
759
760
|
declare function fromJSON<T>(source: SerovalJSON, options?: FromJSONOptions): T;
|
|
760
761
|
//#endregion
|
|
761
|
-
export { type AsyncParsePluginContext, AsyncParserContextOptions, type BaseDeserializerContextOptions, type BaseParserContextOptions, type BaseSerializerContextOptions, type CrossContextOptions, type CrossDeserializerContextOptions, CrossSerializeAsyncOptions, CrossSerializeOptions, CrossSerializeStreamOptions, type CrossSerializerContextOptions, type DeserializePluginContext, Feature, FromCrossJSONOptions, FromJSONOptions, OpaqueReference, Plugin, PluginAccessOptions, PluginData, PluginInfo, type SerializePluginContext, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalJSON, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, type SerovalNode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, type Stream, type StreamListener, type StreamParsePluginContext, type StreamParserContextOptions, type SyncParsePluginContext, SyncParserContextOptions, ToCrossJSONAsyncOptions, ToCrossJSONOptions, ToCrossJSONStreamOptions, type VanillaDeserializerContextOptions, type VanillaSerializerContextOptions, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|
|
762
|
+
export { type AsyncParsePluginContext, AsyncParserContextOptions, type BaseDeserializerContextOptions, type BaseParserContextOptions, type BaseSerializerContextOptions, type CrossContextOptions, type CrossDeserializerContextOptions, CrossSerializeAsyncOptions, CrossSerializeOptions, CrossSerializeStreamOptions, type CrossSerializerContextOptions, type DeserializePluginContext, Feature, FromCrossJSONOptions, FromJSONOptions, OpaqueReference, Plugin, PluginAccessOptions, PluginData, PluginInfo, type SerializePluginContext, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalJSON, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, type SerovalNode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, type Stream, type StreamListener, type StreamParsePluginContext, type StreamParserContextOptions, type SyncParsePluginContext, SyncParserContextOptions, ToCrossJSONAsyncOptions, ToCrossJSONOptions, ToCrossJSONStreamOptions, type VanillaDeserializerContextOptions, type VanillaSerializerContextOptions, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, isStream, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|
package/dist/index.d.ts
CHANGED
|
@@ -737,6 +737,7 @@ interface Stream<T> {
|
|
|
737
737
|
throw(value: unknown): void;
|
|
738
738
|
return(value: T): void;
|
|
739
739
|
}
|
|
740
|
+
declare function isStream<T>(value: object): value is Stream<T>;
|
|
740
741
|
declare function createStream<T>(): Stream<T>;
|
|
741
742
|
//#endregion
|
|
742
743
|
//#region src/core/tree/index.d.ts
|
|
@@ -758,4 +759,4 @@ declare function toJSONAsync<T>(source: T, options?: AsyncParserContextOptions$1
|
|
|
758
759
|
declare function compileJSON(source: SerovalJSON, options?: PluginAccessOptions): string;
|
|
759
760
|
declare function fromJSON<T>(source: SerovalJSON, options?: FromJSONOptions): T;
|
|
760
761
|
//#endregion
|
|
761
|
-
export { type AsyncParsePluginContext, AsyncParserContextOptions, type BaseDeserializerContextOptions, type BaseParserContextOptions, type BaseSerializerContextOptions, type CrossContextOptions, type CrossDeserializerContextOptions, CrossSerializeAsyncOptions, CrossSerializeOptions, CrossSerializeStreamOptions, type CrossSerializerContextOptions, type DeserializePluginContext, Feature, FromCrossJSONOptions, FromJSONOptions, OpaqueReference, Plugin, PluginAccessOptions, PluginData, PluginInfo, type SerializePluginContext, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalJSON, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, type SerovalNode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, type Stream, type StreamListener, type StreamParsePluginContext, type StreamParserContextOptions, type SyncParsePluginContext, SyncParserContextOptions, ToCrossJSONAsyncOptions, ToCrossJSONOptions, ToCrossJSONStreamOptions, type VanillaDeserializerContextOptions, type VanillaSerializerContextOptions, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|
|
762
|
+
export { type AsyncParsePluginContext, AsyncParserContextOptions, type BaseDeserializerContextOptions, type BaseParserContextOptions, type BaseSerializerContextOptions, type CrossContextOptions, type CrossDeserializerContextOptions, CrossSerializeAsyncOptions, CrossSerializeOptions, CrossSerializeStreamOptions, type CrossSerializerContextOptions, type DeserializePluginContext, Feature, FromCrossJSONOptions, FromJSONOptions, OpaqueReference, Plugin, PluginAccessOptions, PluginData, PluginInfo, type SerializePluginContext, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalJSON, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, type SerovalNode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, type Stream, type StreamListener, type StreamParsePluginContext, type StreamParserContextOptions, type SyncParsePluginContext, SyncParserContextOptions, ToCrossJSONAsyncOptions, ToCrossJSONOptions, ToCrossJSONStreamOptions, type VanillaDeserializerContextOptions, type VanillaSerializerContextOptions, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, isStream, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|
package/dist/index.js
CHANGED
|
@@ -1444,13 +1444,15 @@ function deserializePromiseFulfill(ctx, depth, node) {
|
|
|
1444
1444
|
function deserializeIteratorFactoryInstance(ctx, depth, node) {
|
|
1445
1445
|
deserialize$1(ctx, depth, node.a[0]);
|
|
1446
1446
|
const source = deserialize$1(ctx, depth, node.a[1]);
|
|
1447
|
-
|
|
1447
|
+
validateNodeType(ctx, node, node.a[1].i, 35);
|
|
1448
|
+
if (!source) throw new SerovalMalformedNodeError(node.a[1]);
|
|
1448
1449
|
return sequenceToIterator(source);
|
|
1449
1450
|
}
|
|
1450
1451
|
function deserializeAsyncIteratorFactoryInstance(ctx, depth, node) {
|
|
1451
1452
|
deserialize$1(ctx, depth, node.a[0]);
|
|
1452
1453
|
const source = deserialize$1(ctx, depth, node.a[1]);
|
|
1453
|
-
|
|
1454
|
+
validateNodeType(ctx, node, node.a[1].i, 31);
|
|
1455
|
+
if (!source) throw new SerovalMalformedNodeError(node.a[1]);
|
|
1454
1456
|
return streamToAsyncIterable(source);
|
|
1455
1457
|
}
|
|
1456
1458
|
function deserializeStreamConstructor(ctx, depth, node) {
|
|
@@ -1496,6 +1498,7 @@ function deserializeAsyncIteratorFactory(ctx, depth, node) {
|
|
|
1496
1498
|
}
|
|
1497
1499
|
function deserializeSequence(ctx, depth, node) {
|
|
1498
1500
|
const result = assignIndexedValue$1(ctx, node.i, createSequence([], node.s, node.l));
|
|
1501
|
+
assignNodeType(ctx, node.i, 35);
|
|
1499
1502
|
for (let i = 0, len = node.a.length; i < len; i++) result.v[i] = deserialize$1(ctx, depth, node.a[i]);
|
|
1500
1503
|
return result;
|
|
1501
1504
|
}
|
|
@@ -2912,4 +2915,4 @@ function fromJSON(source, options = {}) {
|
|
|
2912
2915
|
}), source.t);
|
|
2913
2916
|
}
|
|
2914
2917
|
//#endregion
|
|
2915
|
-
export { Feature, OpaqueReference, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|
|
2918
|
+
export { Feature, OpaqueReference, Serializer, SerovalConflictedNodeIdError, SerovalDepthLimitError, SerovalDeserializationError, SerovalError, SerovalMalformedNodeError, SerovalMissingInstanceError, SerovalMissingPluginError, SerovalMissingReferenceError, SerovalMissingReferenceForIdError, SerovalMode, SerovalParserError, SerovalSerializationError, SerovalUnknownTypedArrayError, SerovalUnsupportedNodeError, SerovalUnsupportedTypeError, compileJSON, createPlugin, createReference, createStream, crossSerialize, crossSerializeAsync, crossSerializeStream, deserialize, fromCrossJSON, fromJSON, getCrossReferenceHeader, isStream, resolvePlugins, serialize, serializeAsync, toCrossJSON, toCrossJSONAsync, toCrossJSONStream, toJSON, toJSONAsync };
|