seroval 0.11.5 → 0.12.0
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/README.md +29 -16
- package/dist/cjs/development/index.cjs +3012 -4790
- package/dist/cjs/development/index.cjs.map +4 -4
- package/dist/cjs/production/index.cjs +3 -3
- package/dist/esm/development/index.mjs +3010 -4790
- package/dist/esm/development/index.mjs.map +4 -4
- package/dist/esm/production/index.mjs +3 -3
- package/dist/types/core/Serializer.d.ts +2 -0
- package/dist/types/core/Serializer.d.ts.map +1 -0
- package/dist/types/core/UnsupportedTypeError.d.ts +1 -0
- package/dist/types/core/UnsupportedTypeError.d.ts.map +1 -0
- package/dist/types/core/assert.d.ts +1 -0
- package/dist/types/core/assert.d.ts.map +1 -0
- package/dist/types/core/base/async.d.ts +30 -0
- package/dist/types/core/base/async.d.ts.map +1 -0
- package/dist/types/core/base/stream.d.ts +40 -0
- package/dist/types/core/base/stream.d.ts.map +1 -0
- package/dist/types/core/base/sync.d.ts +32 -0
- package/dist/types/core/base/sync.d.ts.map +1 -0
- package/dist/types/core/base-primitives.d.ts +3 -1
- package/dist/types/core/base-primitives.d.ts.map +1 -0
- package/dist/types/core/compat.d.ts +1 -0
- package/dist/types/core/compat.d.ts.map +1 -0
- package/dist/types/core/constants.d.ts +19 -4
- package/dist/types/core/constants.d.ts.map +1 -0
- package/dist/types/core/constructors.d.ts +1 -0
- package/dist/types/core/constructors.d.ts.map +1 -0
- package/dist/types/core/cross/async.d.ts +8 -3
- package/dist/types/core/cross/async.d.ts.map +1 -0
- package/dist/types/core/cross/cross-parser.d.ts +8 -0
- package/dist/types/core/cross/cross-parser.d.ts.map +1 -0
- package/dist/types/core/cross/index.d.ts +12 -5
- package/dist/types/core/cross/index.d.ts.map +1 -0
- package/dist/types/core/cross/serialize.d.ts +23 -5
- package/dist/types/core/cross/serialize.d.ts.map +1 -0
- package/dist/types/core/cross/stream.d.ts +8 -3
- package/dist/types/core/cross/stream.d.ts.map +1 -0
- package/dist/types/core/cross/sync.d.ts +8 -3
- package/dist/types/core/cross/sync.d.ts.map +1 -0
- package/dist/types/core/get-identifier.d.ts +1 -0
- package/dist/types/core/get-identifier.d.ts.map +1 -0
- package/dist/types/core/keys.d.ts +1 -0
- package/dist/types/core/keys.d.ts.map +1 -0
- package/dist/types/core/literals.d.ts +1 -0
- package/dist/types/core/literals.d.ts.map +1 -0
- package/dist/types/core/parser-context.d.ts +23 -0
- package/dist/types/core/parser-context.d.ts.map +1 -0
- package/dist/types/core/plugin.d.ts +26 -0
- package/dist/types/core/plugin.d.ts.map +1 -0
- package/dist/types/core/promise-to-result.d.ts +1 -0
- package/dist/types/core/promise-to-result.d.ts.map +1 -0
- package/dist/types/core/reference.d.ts +1 -0
- package/dist/types/core/reference.d.ts.map +1 -0
- package/dist/types/core/serializer-context.old.d.ts +165 -0
- package/dist/types/core/serializer-context.old.d.ts.map +1 -0
- package/dist/types/core/shared.d.ts +4 -7
- package/dist/types/core/shared.d.ts.map +1 -0
- package/dist/types/core/string.d.ts +1 -0
- package/dist/types/core/string.d.ts.map +1 -0
- package/dist/types/core/tree/async.d.ts +8 -3
- package/dist/types/core/tree/async.d.ts.map +1 -0
- package/dist/types/core/tree/deserialize.d.ts +49 -2
- package/dist/types/core/tree/deserialize.d.ts.map +1 -0
- package/dist/types/core/tree/index.d.ts +10 -7
- package/dist/types/core/tree/index.d.ts.map +1 -0
- package/dist/types/core/tree/serialize.d.ts +37 -4
- package/dist/types/core/tree/serialize.d.ts.map +1 -0
- package/dist/types/core/tree/sync.d.ts +8 -3
- package/dist/types/core/tree/sync.d.ts.map +1 -0
- package/dist/types/core/types.d.ts +10 -3
- package/dist/types/core/types.d.ts.map +1 -0
- package/dist/types/core/web-api.d.ts +1 -0
- package/dist/types/core/web-api.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/types.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/core/Serializer.ts +2 -0
- package/src/core/base/async.ts +804 -0
- package/src/core/base/stream.ts +496 -0
- package/src/core/base/sync.ts +675 -0
- package/src/core/base-primitives.ts +22 -0
- package/src/core/constants.ts +61 -45
- package/src/core/cross/async.ts +6 -743
- package/src/core/cross/cross-parser.ts +9 -0
- package/src/core/cross/index.ts +62 -84
- package/src/core/cross/serialize.ts +71 -862
- package/src/core/cross/stream.ts +6 -868
- package/src/core/cross/sync.ts +6 -623
- package/src/core/is-serializable.new.ts +208 -0
- package/src/core/keys.ts +1 -1
- package/src/core/parser-context.ts +131 -0
- package/src/core/plugin.ts +55 -0
- package/src/core/serializer-context.new.ts +1168 -0
- package/src/core/serializer-context.old.ts +1126 -0
- package/src/core/shared.ts +46 -124
- package/src/core/tree/async.ts +6 -742
- package/src/core/tree/deserialize.ts +423 -420
- package/src/core/tree/index.ts +49 -91
- package/src/core/tree/parser.ts +45 -0
- package/src/core/tree/serialize.ts +122 -828
- package/src/core/tree/sync.ts +6 -623
- package/src/core/types.ts +13 -2
- package/src/example.ts +28 -0
- package/src/index.ts +3 -0
- package/dist/types/core/assignments.d.ts +0 -33
- package/dist/types/core/context.d.ts +0 -9
- package/dist/types/core/cross/context.d.ts +0 -37
- package/dist/types/core/cross/primitives.d.ts +0 -9
- package/dist/types/core/cross/web-api.d.ts +0 -4
- package/dist/types/core/tree/context.d.ts +0 -44
- package/dist/types/core/tree/primitives.d.ts +0 -9
- package/dist/types/core/tree/web-api.d.ts +0 -4
- package/src/core/assignments.ts +0 -159
- package/src/core/context.ts +0 -15
- package/src/core/cross/context.ts +0 -102
- package/src/core/cross/primitives.ts +0 -128
- package/src/core/cross/web-api.ts +0 -50
- package/src/core/tree/context.ts +0 -125
- package/src/core/tree/primitives.ts +0 -123
- package/src/core/tree/web-api.ts +0 -50
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { SerovalPromiseConstructorNode, SerovalPromiseResolveNode, SerovalPromiseRejectNode, SerovalReadableStreamCloseNode, SerovalReadableStreamEnqueueNode, SerovalReadableStreamErrorNode, SerovalReadableStreamConstructorNode, SerovalNode } from '../types';
|
|
2
|
+
import type { BaseSerializerContextOptions } from '../serializer-context.old';
|
|
3
|
+
import BaseSerializerContext from '../serializer-context.old';
|
|
4
|
+
import type { SerovalMode } from '../plugin';
|
|
5
|
+
import type { CrossContextOptions } from './cross-parser';
|
|
6
|
+
export interface CrossSerializerContextOptions extends BaseSerializerContextOptions, CrossContextOptions {
|
|
7
|
+
}
|
|
8
|
+
export default class CrossSerializerContext extends BaseSerializerContext {
|
|
9
|
+
readonly mode: SerovalMode;
|
|
10
|
+
scopeId?: string;
|
|
11
|
+
constructor(options: CrossSerializerContextOptions);
|
|
12
|
+
getRefParam(id: number | string): string;
|
|
13
|
+
protected assignIndexedValue(index: number, value: string): string;
|
|
14
|
+
protected serializePromiseConstructor(node: SerovalPromiseConstructorNode): string;
|
|
15
|
+
protected serializePromiseResolve(node: SerovalPromiseResolveNode): string;
|
|
16
|
+
protected serializePromiseReject(node: SerovalPromiseRejectNode): string;
|
|
17
|
+
protected serializeReadableStreamConstructor(node: SerovalReadableStreamConstructorNode): string;
|
|
18
|
+
protected serializeReadableStreamEnqueue(node: SerovalReadableStreamEnqueueNode): string;
|
|
19
|
+
protected serializeReadableStreamError(node: SerovalReadableStreamErrorNode): string;
|
|
20
|
+
protected serializeReadableStreamClose(node: SerovalReadableStreamCloseNode): string;
|
|
21
|
+
serializeTop(tree: SerovalNode): string;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../../../src/core/cross/serialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,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
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import type { BaseStreamParserContextOptions } from '../base/stream';
|
|
2
|
+
import BaseStreamParserContext from '../base/stream';
|
|
3
|
+
import type { SerovalMode } from '../plugin';
|
|
4
|
+
export type CrossStreamParserContextOptions = BaseStreamParserContextOptions;
|
|
5
|
+
export default class CrossStreamParserContext extends BaseStreamParserContext {
|
|
6
|
+
readonly mode: SerovalMode;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../../../src/core/cross/stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,uBAAuB,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,MAAM,+BAA+B,GAAG,8BAA8B,CAAA;AAE5E,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,uBAAuB;IAC3E,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAW;CACtC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
|
|
1
|
+
import BaseSyncParserContext from '../base/sync';
|
|
2
|
+
import type { SerovalMode } from '../plugin';
|
|
3
|
+
import type { CrossParserContextOptions } from './cross-parser';
|
|
4
|
+
export type CrossSyncParserContextOptions = CrossParserContextOptions;
|
|
5
|
+
export default class CrossSyncParserContext extends BaseSyncParserContext {
|
|
6
|
+
readonly mode: SerovalMode;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/core/cross/sync.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,MAAM,6BAA6B,GAAG,yBAAyB,CAAA;AAErE,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,qBAAqB;IACvE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAW;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-identifier.d.ts","sourceRoot":"","sources":["../../../src/core/get-identifier.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAU3D"}
|
|
@@ -11,3 +11,4 @@ export declare const GLOBAL_CONTEXT_STREAM_CONSTRUCTOR = "S";
|
|
|
11
11
|
export declare const GLOBAL_CONTEXT_STREAM_EMIT = "Se";
|
|
12
12
|
export declare const GLOBAL_CONTEXT_API_SCRIPT: string;
|
|
13
13
|
export declare function getCrossReferenceHeader(id?: string): string;
|
|
14
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/core/keys.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,eAAO,MAAM,kCAAkC,MAAM,CAAC;AAEtD,eAAO,MAAM,8BAA8B,OAAO,CAAC;AAEnD,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAElD,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD,eAAO,MAAM,iCAAiC,MAAM,CAAC;AAErD,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,eAAO,MAAM,yBAAyB,QAQ/B,CAAC;AAER,wBAAgB,uBAAuB,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAK3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literals.d.ts","sourceRoot":"","sources":["../../../src/core/literals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAmBnD,eAAO,MAAM,SAAS,qBAA2C,CAAC;AAClE,eAAO,MAAM,UAAU,qBAA4C,CAAC;AACpE,eAAO,MAAM,cAAc,qBAAgD,CAAC;AAC5E,eAAO,MAAM,SAAS,qBAA2C,CAAC;AAClE,eAAO,MAAM,aAAa,qBAAmD,CAAC;AAC9E,eAAO,MAAM,aAAa,qBAA+C,CAAC;AAC1E,eAAO,MAAM,iBAAiB,qBAAuD,CAAC;AACtF,eAAO,MAAM,QAAQ,qBAA0C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Plugin, PluginAccessOptions, SerovalMode } from './plugin';
|
|
2
|
+
import type { SerovalIndexedValueNode, SerovalReferenceNode } from './types';
|
|
3
|
+
export interface BaseParserContextOptions extends PluginAccessOptions {
|
|
4
|
+
disabledFeatures?: number;
|
|
5
|
+
refs?: Map<unknown, number>;
|
|
6
|
+
}
|
|
7
|
+
export declare abstract class BaseParserContext implements PluginAccessOptions {
|
|
8
|
+
abstract readonly mode: SerovalMode;
|
|
9
|
+
features: number;
|
|
10
|
+
marked: Set<number>;
|
|
11
|
+
refs: Map<unknown, number>;
|
|
12
|
+
plugins?: Plugin<any, any>[] | undefined;
|
|
13
|
+
constructor(options: BaseParserContextOptions);
|
|
14
|
+
protected markRef(id: number): void;
|
|
15
|
+
protected isMarked(id: number): boolean;
|
|
16
|
+
protected getReference<T>(current: T): number | SerovalIndexedValueNode | SerovalReferenceNode;
|
|
17
|
+
protected getStrictReference<T>(current: T): SerovalIndexedValueNode | SerovalReferenceNode;
|
|
18
|
+
/**
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
protected isIterable(value: unknown): value is Iterable<unknown>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=parser-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser-context.d.ts","sourceRoot":"","sources":["../../../src/core/parser-context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE7E,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACnE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;CAC7B;AAED,8BAAsB,iBAAkB,YAAW,mBAAmB;IACpE,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAEpC,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,cAAqB;IAE3B,IAAI,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAE3B,OAAO,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,SAAS,CAAC;gBAE7B,OAAO,EAAE,wBAAwB;IAM7C,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAInC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIvC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,MAAM,GAAG,uBAAuB,GAAG,oBAAoB;IAc9F,SAAS,CAAC,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,uBAAuB,GAAG,oBAAoB;IAW3F;;OAEG;IACH,SAAS,CAAC,UAAU,CAClB,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,QAAQ,CAAC,OAAO,CAAC;CAgE9B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type BaseAsyncParserContext from './base/async';
|
|
2
|
+
import type BaseStreamParserContext from './base/stream';
|
|
3
|
+
import type BaseSyncParserContext from './base/sync';
|
|
4
|
+
import type BaseSerializerContext from './serializer-context.old';
|
|
5
|
+
import type VanillaDeserializerContext from './tree/deserialize';
|
|
6
|
+
export type SerovalMode = 'vanilla' | 'cross';
|
|
7
|
+
export interface PluginData {
|
|
8
|
+
id: number;
|
|
9
|
+
}
|
|
10
|
+
export interface Plugin<Value, Node> {
|
|
11
|
+
tag: string;
|
|
12
|
+
test(value: unknown): boolean;
|
|
13
|
+
parse: {
|
|
14
|
+
sync?: (value: Value, ctx: BaseSyncParserContext, data: PluginData) => Node;
|
|
15
|
+
async?: (value: Value, ctx: BaseAsyncParserContext, data: PluginData) => Promise<Node>;
|
|
16
|
+
stream?: (value: Value, ctx: BaseStreamParserContext, data: PluginData) => Node;
|
|
17
|
+
};
|
|
18
|
+
serialize(node: Node, ctx: BaseSerializerContext, data: PluginData): string;
|
|
19
|
+
deserialize(node: Node, ctx: VanillaDeserializerContext, data: PluginData): Value;
|
|
20
|
+
isIterable?: (value: Value) => boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function createPlugin<Value, Node>(plugin: Plugin<Value, Node>): Plugin<Value, Node>;
|
|
23
|
+
export interface PluginAccessOptions {
|
|
24
|
+
plugins?: Plugin<any, any>[];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/core/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,sBAAsB,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,uBAAuB,MAAM,eA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;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promise-to-result.d.ts","sourceRoot":"","sources":["../../../src/core/promise-to-result.ts"],"names":[],"mappings":"AAAA,wBAA8B,eAAe,CAC3C,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GACxB,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAM3B"}
|
|
@@ -3,3 +3,4 @@ export declare function hasReferenceID<T>(value: T): boolean;
|
|
|
3
3
|
export declare function hasReference(id: string): boolean;
|
|
4
4
|
export declare function getReferenceID<T>(value: T): string;
|
|
5
5
|
export declare function getReference<T>(id: string): T;
|
|
6
|
+
//# sourceMappingURL=reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../src/core/reference.ts"],"names":[],"mappings":"AAOA,wBAAgB,eAAe,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAI1D;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAEnD;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAGlD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,CAG7C"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { SerovalObjectFlags } from './constants';
|
|
2
|
+
import type { Plugin, PluginAccessOptions, SerovalMode } from './plugin';
|
|
3
|
+
import type { SerovalArrayNode, SerovalNode, SerovalObjectRecordKey, SerovalObjectRecordNode, SerovalReferenceNode, SerovalObjectNode, SerovalNullConstructorNode, SerovalRegExpNode, SerovalDateNode, SerovalSetNode, SerovalMapNode, SerovalArrayBufferNode, SerovalTypedArrayNode, SerovalBigIntTypedArrayNode, SerovalDataViewNode, SerovalAggregateErrorNode, SerovalErrorNode, SerovalPromiseNode, SerovalWKSymbolNode, SerovalURLNode, SerovalURLSearchParamsNode, SerovalBlobNode, SerovalFileNode, SerovalHeadersNode, SerovalFormDataNode, SerovalBoxedNode, SerovalRequestNode, SerovalResponseNode, SerovalEventNode, SerovalCustomEventNode, SerovalDOMExceptionNode, SerovalPluginNode, SerovalPromiseConstructorNode, SerovalPromiseResolveNode, SerovalPromiseRejectNode, SerovalReadableStreamConstructorNode, SerovalReadableStreamEnqueueNode, SerovalReadableStreamErrorNode, SerovalReadableStreamCloseNode } from './types';
|
|
4
|
+
interface IndexAssignment {
|
|
5
|
+
t: 'index';
|
|
6
|
+
s: string;
|
|
7
|
+
k: undefined;
|
|
8
|
+
v: string;
|
|
9
|
+
}
|
|
10
|
+
interface SetAssignment {
|
|
11
|
+
t: 'set';
|
|
12
|
+
s: string;
|
|
13
|
+
k: string;
|
|
14
|
+
v: string;
|
|
15
|
+
}
|
|
16
|
+
interface AddAssignment {
|
|
17
|
+
t: 'add';
|
|
18
|
+
s: string;
|
|
19
|
+
k: undefined;
|
|
20
|
+
v: string;
|
|
21
|
+
}
|
|
22
|
+
interface DeleteAssignment {
|
|
23
|
+
t: 'delete';
|
|
24
|
+
s: string;
|
|
25
|
+
k: string;
|
|
26
|
+
v: undefined;
|
|
27
|
+
}
|
|
28
|
+
type Assignment = IndexAssignment | AddAssignment | SetAssignment | DeleteAssignment;
|
|
29
|
+
export interface FlaggedObject {
|
|
30
|
+
type: SerovalObjectFlags;
|
|
31
|
+
value: string;
|
|
32
|
+
}
|
|
33
|
+
declare const enum SpecialReference {
|
|
34
|
+
Sentinel = 0
|
|
35
|
+
}
|
|
36
|
+
export interface BaseSerializerContextOptions extends PluginAccessOptions {
|
|
37
|
+
features: number;
|
|
38
|
+
markedRefs: number[] | Set<number>;
|
|
39
|
+
}
|
|
40
|
+
export default abstract class BaseSerializerContext implements PluginAccessOptions {
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
*/
|
|
44
|
+
features: number;
|
|
45
|
+
/**
|
|
46
|
+
* To check if an object is synchronously referencing itself
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
stack: number[];
|
|
50
|
+
/**
|
|
51
|
+
* Array of object mutations
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
|
+
flags: FlaggedObject[];
|
|
55
|
+
/**
|
|
56
|
+
* Array of assignments to be done (used for recursion)
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
59
|
+
assignments: Assignment[];
|
|
60
|
+
plugins?: Plugin<any, any>[] | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Refs that are...referenced
|
|
63
|
+
* @private
|
|
64
|
+
*/
|
|
65
|
+
marked: Set<number>;
|
|
66
|
+
constructor(options: BaseSerializerContextOptions);
|
|
67
|
+
abstract readonly mode: SerovalMode;
|
|
68
|
+
/**
|
|
69
|
+
* A tiny function that tells if a reference
|
|
70
|
+
* is to be accessed. This is a requirement for
|
|
71
|
+
* deciding whether or not we should generate
|
|
72
|
+
* an identifier for the object
|
|
73
|
+
*/
|
|
74
|
+
protected markRef(id: number): void;
|
|
75
|
+
protected isMarked(id: number): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Converts the ID of a reference into a identifier string
|
|
78
|
+
* that is used to refer to the object instance in the
|
|
79
|
+
* generated script.
|
|
80
|
+
*/
|
|
81
|
+
abstract getRefParam(id: number | string): string;
|
|
82
|
+
private specials;
|
|
83
|
+
/**
|
|
84
|
+
* Generates special references that isn't provided by the user
|
|
85
|
+
* but by the script.
|
|
86
|
+
*/
|
|
87
|
+
protected getSpecialReference(ref: SpecialReference): string;
|
|
88
|
+
protected pushObjectFlag(flag: SerovalObjectFlags, id: number): void;
|
|
89
|
+
private resolveFlags;
|
|
90
|
+
protected resolvePatches(): string | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Generates the inlined assignment for the reference
|
|
93
|
+
* This is different from the assignments array as this one
|
|
94
|
+
* signifies creation rather than mutation
|
|
95
|
+
*/
|
|
96
|
+
protected createAssignment(source: string, value: string): void;
|
|
97
|
+
protected createAddAssignment(ref: number, value: string): void;
|
|
98
|
+
protected createSetAssignment(ref: number, key: string, value: string): void;
|
|
99
|
+
protected createDeleteAssignment(ref: number, key: string): void;
|
|
100
|
+
protected createArrayAssign(ref: number, index: number | string, value: string): void;
|
|
101
|
+
protected createObjectAssign(ref: number, key: string, value: string): void;
|
|
102
|
+
/**
|
|
103
|
+
* Checks if the value is in the stack. Stack here is a reference
|
|
104
|
+
* structure to know if a object is to be accessed in a TDZ.
|
|
105
|
+
*/
|
|
106
|
+
isIndexedValueInStack(node: SerovalNode): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Produces an assignment expression. `id` generates a reference
|
|
109
|
+
* parameter (through `getRefParam`) and has the option to
|
|
110
|
+
* return the reference parameter directly or assign a value to
|
|
111
|
+
* it.
|
|
112
|
+
*/
|
|
113
|
+
protected abstract assignIndexedValue(id: number, value: string): string;
|
|
114
|
+
protected serializeReference(node: SerovalReferenceNode): string;
|
|
115
|
+
protected getIterableAccess(): string;
|
|
116
|
+
protected serializeIterable(node: SerovalNode): string;
|
|
117
|
+
protected serializeArrayItem(id: number, item: SerovalNode | undefined, index: number): string;
|
|
118
|
+
protected serializeArray(node: SerovalArrayNode): string;
|
|
119
|
+
protected serializeProperty(id: number, key: SerovalObjectRecordKey, val: SerovalNode): string;
|
|
120
|
+
protected serializeProperties(sourceID: number, node: SerovalObjectRecordNode): string;
|
|
121
|
+
protected serializeObject(node: SerovalObjectNode): string;
|
|
122
|
+
protected serializeWithObjectAssign(value: SerovalObjectRecordNode, id: number, serialized: string): string;
|
|
123
|
+
protected serializeAssignment(sourceID: number, mainAssignments: Assignment[], key: SerovalObjectRecordKey, value: SerovalNode): void;
|
|
124
|
+
protected serializeAssignments(sourceID: number, node: SerovalObjectRecordNode): string | undefined;
|
|
125
|
+
protected serializeDictionary(i: number, p: SerovalObjectRecordNode | undefined, init: string): string;
|
|
126
|
+
protected serializeNullConstructor(node: SerovalNullConstructorNode): string;
|
|
127
|
+
protected serializeDate(node: SerovalDateNode): string;
|
|
128
|
+
protected serializeRegExp(node: SerovalRegExpNode): string;
|
|
129
|
+
protected serializeSetItem(id: number, item: SerovalNode): string;
|
|
130
|
+
protected serializeSet(node: SerovalSetNode): string;
|
|
131
|
+
protected serializeMapEntry(id: number, key: SerovalNode, val: SerovalNode): string;
|
|
132
|
+
protected serializeMap(node: SerovalMapNode): string;
|
|
133
|
+
protected serializeArrayBuffer(node: SerovalArrayBufferNode): string;
|
|
134
|
+
protected serializeTypedArray(node: SerovalTypedArrayNode | SerovalBigIntTypedArrayNode): string;
|
|
135
|
+
protected serializeDataView(node: SerovalDataViewNode): string;
|
|
136
|
+
protected serializeAggregateError(node: SerovalAggregateErrorNode): string;
|
|
137
|
+
protected serializeError(node: SerovalErrorNode): string;
|
|
138
|
+
protected serializePromise(node: SerovalPromiseNode): string;
|
|
139
|
+
protected serializeWKSymbol(node: SerovalWKSymbolNode): string;
|
|
140
|
+
protected serializeURL(node: SerovalURLNode): string;
|
|
141
|
+
protected serializeURLSearchParams(node: SerovalURLSearchParamsNode): string;
|
|
142
|
+
protected serializeBlob(node: SerovalBlobNode): string;
|
|
143
|
+
protected serializeFile(node: SerovalFileNode): string;
|
|
144
|
+
protected serializeHeaders(node: SerovalHeadersNode): string;
|
|
145
|
+
protected serializeFormDataEntry(id: number, key: string, value: SerovalNode): string;
|
|
146
|
+
protected serializeFormDataEntries(node: SerovalFormDataNode, size: number): string;
|
|
147
|
+
protected serializeFormData(node: SerovalFormDataNode): string;
|
|
148
|
+
protected serializeBoxed(node: SerovalBoxedNode): string;
|
|
149
|
+
protected serializeRequest(node: SerovalRequestNode): string;
|
|
150
|
+
protected serializeResponse(node: SerovalResponseNode): string;
|
|
151
|
+
protected serializeEvent(node: SerovalEventNode): string;
|
|
152
|
+
protected serializeCustomEvent(node: SerovalCustomEventNode): string;
|
|
153
|
+
protected serializeDOMException(node: SerovalDOMExceptionNode): string;
|
|
154
|
+
protected serializePlugin(node: SerovalPluginNode): string;
|
|
155
|
+
protected abstract serializePromiseConstructor(node: SerovalPromiseConstructorNode): string;
|
|
156
|
+
protected abstract serializePromiseResolve(node: SerovalPromiseResolveNode): string;
|
|
157
|
+
protected abstract serializePromiseReject(node: SerovalPromiseRejectNode): string;
|
|
158
|
+
protected abstract serializeReadableStreamConstructor(node: SerovalReadableStreamConstructorNode): string;
|
|
159
|
+
protected abstract serializeReadableStreamEnqueue(node: SerovalReadableStreamEnqueueNode): string;
|
|
160
|
+
protected abstract serializeReadableStreamError(node: SerovalReadableStreamErrorNode): string;
|
|
161
|
+
protected abstract serializeReadableStreamClose(node: SerovalReadableStreamCloseNode): string;
|
|
162
|
+
serialize(node: SerovalNode): string;
|
|
163
|
+
}
|
|
164
|
+
export {};
|
|
165
|
+
//# sourceMappingURL=serializer-context.old.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer-context.old.d.ts","sourceRoot":"","sources":["../../../src/core/serializer-context.old.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,KAAK,EACV,gBAAgB,EAEhB,WAAW,EACX,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,0BAA0B,EAC1B,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,cA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CAC5C,IAAI,EAAE,6BAA6B,GAClC,MAAM;IAET,SAAS,CAAC,QAAQ,CAAC,uBAAuB,CACxC,IAAI,EAAE,yBAAyB,GAC9B,MAAM;IAET,SAAS,CAAC,QAAQ,CAAC,sBAAsB,CACvC,IAAI,EAAE,wBAAwB,GAC7B,MAAM;IAET,SAAS,CAAC,QAAQ,CAAC,kCAAkC,CACnD,IAAI,EAAE,oCAAoC,GACzC,MAAM;IAET,SAAS,CAAC,QAAQ,CAAC,8BAA8B,CAC/C,IAAI,EAAE,gCAAgC,GACrC,MAAM;IAET,SAAS,CAAC,QAAQ,CAAC,4BAA4B,CAC7C,IAAI,EAAE,8BAA8B,GACnC,MAAM;IAET,SAAS,CAAC,QAAQ,CAAC,4BAA4B,CAC7C,IAAI,EAAE,8BAA8B,GACnC,MAAM;IAET,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM;CAuFrC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import type { ErrorValue } from '../types';
|
|
2
|
-
import { SerovalObjectFlags } from './constants';
|
|
3
|
-
|
|
4
|
-
export declare function getErrorConstructorName(error: ErrorValue): string;
|
|
5
|
-
type ErrorConstructors = ErrorConstructor | EvalErrorConstructor | RangeErrorConstructor | ReferenceErrorConstructor | SyntaxErrorConstructor | TypeErrorConstructor | URIErrorConstructor;
|
|
6
|
-
export declare function getErrorConstructor(errorName: string): ErrorConstructors;
|
|
7
|
-
export declare function getErrorOptions(ctx: BaseParserContext, error: Error): Record<string, unknown> | undefined;
|
|
8
|
-
export declare function isIterable(ctx: BaseParserContext, value: unknown): value is Iterable<unknown>;
|
|
2
|
+
import { ErrorConstructorTag, SerovalObjectFlags } from './constants';
|
|
3
|
+
export declare function getErrorConstructor(error: ErrorValue): ErrorConstructorTag;
|
|
9
4
|
type TypedArrayConstructor = Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor | Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | Uint8ClampedArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor | BigInt64ArrayConstructor | BigUint64ArrayConstructor;
|
|
10
5
|
export declare function getTypedArrayConstructor(name: string): TypedArrayConstructor;
|
|
11
6
|
export declare function isValidIdentifier(name: string): boolean;
|
|
12
7
|
export declare function getObjectFlag(obj: unknown): SerovalObjectFlags;
|
|
8
|
+
export declare function getErrorOptions(error: Error, features: number): Record<string, unknown> | undefined;
|
|
13
9
|
export {};
|
|
10
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/core/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACX,MAAM,UAAU,CAAC;AAElB,OAAO,EAEL,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,CAoB1E;AAED,KAAK,qBAAqB,GACtB,oBAAoB,GACpB,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,sBAAsB,GACtB,sBAAsB,GACtB,4BAA4B,GAC5B,uBAAuB,GACvB,uBAAuB,GACvB,wBAAwB,GACxB,yBAAyB,CAAC;AAE9B,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,CAgB5E;AAID,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQvD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,CAW9D;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,MAAM,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CA2BrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/core/string.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAc7D;AAOD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAiBnD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAYrD"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
|
|
1
|
+
import BaseAsyncParserContext from '../base/async';
|
|
2
|
+
import type { BaseParserContextOptions } from '../parser-context';
|
|
3
|
+
import type { SerovalMode } from '../plugin';
|
|
4
|
+
export type AsyncParserContextOptions = Omit<BaseParserContextOptions, 'refs'>;
|
|
5
|
+
export default class AsyncParserContext extends BaseAsyncParserContext {
|
|
6
|
+
readonly mode: SerovalMode;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=async.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../../src/core/tree/async.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAA;AAE9E,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,sBAAsB;IACpE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAa;CACxC"}
|
|
@@ -1,3 +1,50 @@
|
|
|
1
|
-
import type { DeserializerContext } from './context';
|
|
2
1
|
import type { SerovalNode } from '../types';
|
|
3
|
-
|
|
2
|
+
import type { Plugin, PluginAccessOptions } from '../plugin';
|
|
3
|
+
export interface DeserializerOptions extends PluginAccessOptions {
|
|
4
|
+
markedRefs: number[] | Set<number>;
|
|
5
|
+
}
|
|
6
|
+
export default class VanillaDeserializerContext implements PluginAccessOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Mapping ids to values
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
values: Map<number, unknown>;
|
|
12
|
+
/**
|
|
13
|
+
* Which refs are pre-marked
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
refs: Set<number>;
|
|
17
|
+
plugins?: Plugin<any, any>[] | undefined;
|
|
18
|
+
constructor(options: DeserializerOptions);
|
|
19
|
+
assignIndexedValue<T>(index: number, value: T): T;
|
|
20
|
+
private deserializeReference;
|
|
21
|
+
private deserializeArray;
|
|
22
|
+
private deserializeProperties;
|
|
23
|
+
private deserializeObject;
|
|
24
|
+
private deserializeDate;
|
|
25
|
+
private deserializeRegExp;
|
|
26
|
+
private deserializeSet;
|
|
27
|
+
private deserializeMap;
|
|
28
|
+
private deserializeArrayBuffer;
|
|
29
|
+
private deserializeTypedArray;
|
|
30
|
+
private deserializeDataView;
|
|
31
|
+
private deserializeDictionary;
|
|
32
|
+
private deserializeAggregateError;
|
|
33
|
+
private deserializeError;
|
|
34
|
+
private deserializePromise;
|
|
35
|
+
private deserializeURL;
|
|
36
|
+
private deserializeURLSearchParams;
|
|
37
|
+
private deserializeBlob;
|
|
38
|
+
private deserializeFile;
|
|
39
|
+
private deserializeHeaders;
|
|
40
|
+
private deserializeFormData;
|
|
41
|
+
private deserializeBoxed;
|
|
42
|
+
private deserializeRequest;
|
|
43
|
+
private deserializeResponse;
|
|
44
|
+
private deserializeEvent;
|
|
45
|
+
private deserializeCustomEvent;
|
|
46
|
+
private deserializeDOMException;
|
|
47
|
+
private deserializePlugin;
|
|
48
|
+
deserialize(node: SerovalNode): unknown;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=deserialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deserialize.d.ts","sourceRoot":"","sources":["../../../../src/core/tree/deserialize.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IASxB,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,uBAAuB;IAY/B,OAAO,CAAC,iBAAiB;IAezB,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO;CAwExC"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import type { PluginAccessOptions } from '../plugin';
|
|
1
2
|
import type { SerovalNode } from '../types';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
3
|
+
import type { AsyncParserContextOptions } from './async';
|
|
4
|
+
import type { SyncParserContextOptions } from './sync';
|
|
5
|
+
export declare function serialize<T>(source: T, options?: SyncParserContextOptions): string;
|
|
6
|
+
export declare function serializeAsync<T>(source: T, options?: AsyncParserContextOptions): Promise<string>;
|
|
5
7
|
export declare function deserialize<T>(source: string): T;
|
|
6
8
|
export interface SerovalJSON {
|
|
7
9
|
t: SerovalNode;
|
|
8
10
|
f: number;
|
|
9
11
|
m: number[];
|
|
10
12
|
}
|
|
11
|
-
export declare function toJSON<T>(source: T, options?:
|
|
12
|
-
export declare function toJSONAsync<T>(source: T, options?:
|
|
13
|
-
export declare function compileJSON(source: SerovalJSON): string;
|
|
14
|
-
export declare function fromJSON<T>(source: SerovalJSON): T;
|
|
13
|
+
export declare function toJSON<T>(source: T, options?: SyncParserContextOptions): SerovalJSON;
|
|
14
|
+
export declare function toJSONAsync<T>(source: T, options?: AsyncParserContextOptions): Promise<SerovalJSON>;
|
|
15
|
+
export declare function compileJSON(source: SerovalJSON, options?: PluginAccessOptions): string;
|
|
16
|
+
export declare function fromJSON<T>(source: SerovalJSON, options?: PluginAccessOptions): T;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/tree/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAIzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAGvD,wBAAgB,SAAS,CAAC,CAAC,EACzB,MAAM,EAAE,CAAC,EACT,OAAO,GAAE,wBAA6B,GACrC,MAAM,CAYR;AAED,wBAAsB,cAAc,CAAC,CAAC,EACpC,MAAM,EAAE,CAAC,EACT,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,MAAM,CAAC,CAYjB;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,CAGhD;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,WAAW,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,EAAE,CAAC;CACb;AAED,wBAAgB,MAAM,CAAC,CAAC,EACtB,MAAM,EAAE,CAAC,EACT,OAAO,GAAE,wBAA6B,GACrC,WAAW,CAUb;AAED,wBAAsB,WAAW,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,WAAW,CAAC,CAUtB;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAO1F;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAE,mBAAwB,GAAG,CAAC,CAMrF"}
|
|
@@ -1,4 +1,37 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { SerovalNode, SerovalPromiseConstructorNode, SerovalPromiseRejectNode, SerovalPromiseResolveNode, SerovalReadableStreamCloseNode, SerovalReadableStreamConstructorNode, SerovalReadableStreamEnqueueNode, SerovalReadableStreamErrorNode } from '../types';
|
|
2
|
+
import type { BaseSerializerContextOptions } from '../serializer-context.old';
|
|
3
|
+
import BaseSerializerContext from '../serializer-context.old';
|
|
4
|
+
import type { SerovalMode } from '../plugin';
|
|
5
|
+
export type VanillaSerializerContextOptions = BaseSerializerContextOptions;
|
|
6
|
+
export default class VanillaSerializerContext extends BaseSerializerContext {
|
|
7
|
+
readonly mode: SerovalMode;
|
|
8
|
+
/**
|
|
9
|
+
* Map tree refs to actual refs
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
valid: Map<string | number, number>;
|
|
13
|
+
/**
|
|
14
|
+
* Variables
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
vars: (string | undefined)[];
|
|
18
|
+
/**
|
|
19
|
+
* Increments the number of references the referenced value has
|
|
20
|
+
*/
|
|
21
|
+
markRef(current: number): void;
|
|
22
|
+
/**
|
|
23
|
+
* Creates the reference param (identifier) from the given reference ID
|
|
24
|
+
* Calling this function means the value has been referenced somewhere
|
|
25
|
+
*/
|
|
26
|
+
getRefParam(index: number | string): string;
|
|
27
|
+
protected assignIndexedValue(index: number, value: string): string;
|
|
28
|
+
protected serializePromiseConstructor(node: SerovalPromiseConstructorNode): string;
|
|
29
|
+
protected serializePromiseResolve(node: SerovalPromiseResolveNode): string;
|
|
30
|
+
protected serializePromiseReject(node: SerovalPromiseRejectNode): string;
|
|
31
|
+
protected serializeReadableStreamConstructor(node: SerovalReadableStreamConstructorNode): string;
|
|
32
|
+
protected serializeReadableStreamEnqueue(node: SerovalReadableStreamEnqueueNode): string;
|
|
33
|
+
protected serializeReadableStreamError(node: SerovalReadableStreamErrorNode): string;
|
|
34
|
+
protected serializeReadableStreamClose(node: SerovalReadableStreamCloseNode): string;
|
|
35
|
+
serializeTop(tree: SerovalNode): string;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@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AS,CAAC,4BAA4B,CACpC,IAAI,EAAE,8BAA8B,GACnC,MAAM;IAIT,SAAS,CAAC,4BAA4B,CACpC,IAAI,EAAE,8BAA8B,GACnC,MAAM;IAIT,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM;CA+BxC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
|
|
1
|
+
import BaseSyncParserContext from '../base/sync';
|
|
2
|
+
import type { BaseParserContextOptions } from '../parser-context';
|
|
3
|
+
import type { SerovalMode } from '../plugin';
|
|
4
|
+
export type SyncParserContextOptions = Omit<BaseParserContextOptions, 'refs'>;
|
|
5
|
+
export default class SyncParserContext extends BaseSyncParserContext {
|
|
6
|
+
readonly mode: SerovalMode;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/core/tree/sync.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;AAE9E,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,qBAAqB;IAClE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAa;CACxC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SerovalNodeType, SerovalObjectFlags, SerovalConstant, Symbols } from './constants';
|
|
1
|
+
import type { SerovalNodeType, SerovalObjectFlags, SerovalConstant, Symbols, ErrorConstructorTag } from './constants';
|
|
2
2
|
export interface SerovalBaseNode {
|
|
3
3
|
t: SerovalNodeType;
|
|
4
4
|
i: number | undefined;
|
|
@@ -124,7 +124,7 @@ export interface SerovalPromiseNode extends SerovalBaseNode {
|
|
|
124
124
|
}
|
|
125
125
|
export interface SerovalErrorNode extends SerovalBaseNode {
|
|
126
126
|
t: SerovalNodeType.Error;
|
|
127
|
-
|
|
127
|
+
s: ErrorConstructorTag;
|
|
128
128
|
m: string;
|
|
129
129
|
p: SerovalObjectRecordNode | undefined;
|
|
130
130
|
i: number;
|
|
@@ -252,6 +252,13 @@ export interface SerovalDOMExceptionNode extends SerovalBaseNode {
|
|
|
252
252
|
s: string;
|
|
253
253
|
c: string;
|
|
254
254
|
}
|
|
255
|
-
export
|
|
255
|
+
export interface SerovalPluginNode extends SerovalBaseNode {
|
|
256
|
+
t: SerovalNodeType.Plugin;
|
|
257
|
+
i: number;
|
|
258
|
+
s: unknown;
|
|
259
|
+
c: string;
|
|
260
|
+
}
|
|
261
|
+
export type SerovalSyncNode = SerovalPrimitiveNode | SerovalIndexedValueNode | SerovalSemiPrimitiveNode | SerovalSetNode | SerovalMapNode | SerovalArrayNode | SerovalObjectNode | SerovalNullConstructorNode | SerovalPromiseNode | SerovalErrorNode | SerovalAggregateErrorNode | SerovalWKSymbolNode | SerovalURLNode | SerovalURLSearchParamsNode | SerovalReferenceNode | SerovalArrayBufferNode | SerovalDataViewNode | SerovalBlobNode | SerovalFileNode | SerovalHeadersNode | SerovalFormDataNode | SerovalBoxedNode | SerovalEventNode | SerovalCustomEventNode | SerovalDOMExceptionNode | SerovalPluginNode;
|
|
256
262
|
export type SerovalAsyncNode = SerovalPromiseNode | SerovalBlobNode | SerovalFileNode | SerovalPromiseConstructorNode | SerovalPromiseResolveNode | SerovalPromiseRejectNode | SerovalReadableStreamConstructorNode | SerovalReadableStreamEnqueueNode | SerovalReadableStreamCloseNode | SerovalReadableStreamErrorNode | SerovalRequestNode | SerovalResponseNode;
|
|
257
263
|
export type SerovalNode = SerovalSyncNode | SerovalAsyncNode;
|
|
264
|
+
//# sourceMappingURL=types.d.ts.map
|