seroval 1.7.10 → 1.8.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/dev/index.cjs +58 -3893
- package/dist/dev/index.d.cts +5 -834
- package/dist/dev/index.d.ts +5 -834
- package/dist/dev/index.js +4 -3847
- package/dist/dev/read-BgToBbWd.js +455 -0
- package/dist/dev/read-Bn_ffmiS.d.ts +14 -0
- package/dist/dev/read-CgzYPh_Q.d.cts +14 -0
- package/dist/dev/read-D4n-bxUW.cjs +478 -0
- package/dist/dev/read.cjs +45 -0
- package/dist/dev/read.d.cts +17 -0
- package/dist/dev/read.d.ts +17 -0
- package/dist/dev/read.js +3 -0
- package/dist/dev/shared-Cf-Bmoy-.js +1010 -0
- package/dist/dev/shared-DTMVoS-y.d.ts +749 -0
- package/dist/dev/shared-DWx3Bwb6.cjs +1410 -0
- package/dist/dev/shared-Dju99SLx.d.cts +749 -0
- package/dist/dev/shared.cjs +40 -0
- package/dist/dev/shared.d.cts +2 -0
- package/dist/dev/shared.d.ts +2 -0
- package/dist/dev/shared.js +1 -0
- package/dist/dev/typed-array-C3haUQv_.js +72 -0
- package/dist/dev/typed-array-DUH_YsNc.cjs +101 -0
- package/dist/dev/validator-CxDhXc0k.d.cts +28 -0
- package/dist/dev/validator-CxDhXc0k.d.ts +28 -0
- package/dist/dev/validator.cjs +54 -0
- package/dist/dev/validator.d.cts +2 -0
- package/dist/dev/validator.d.ts +2 -0
- package/dist/dev/validator.js +45 -0
- package/dist/dev/write-BKJsV31u.js +2354 -0
- package/dist/dev/write-C0KqlAXN.d.ts +86 -0
- package/dist/dev/write-DGOp2jqo.cjs +2425 -0
- package/dist/dev/write-KxJKA4_p.d.cts +86 -0
- package/dist/dev/write.cjs +54 -0
- package/dist/dev/write.d.cts +4 -0
- package/dist/dev/write.d.ts +4 -0
- package/dist/dev/write.js +3 -0
- package/dist/index.cjs +58 -3877
- package/dist/index.d.cts +5 -834
- package/dist/index.d.ts +5 -834
- package/dist/index.js +4 -3831
- package/dist/read-B0hu4YND.cjs +478 -0
- package/dist/read-BSFu4fPn.js +455 -0
- package/dist/read-Bn_ffmiS.d.ts +14 -0
- package/dist/read-CgzYPh_Q.d.cts +14 -0
- package/dist/read.cjs +45 -0
- package/dist/read.d.cts +17 -0
- package/dist/read.d.ts +17 -0
- package/dist/read.js +3 -0
- package/dist/shared-DJIVyqa9.js +994 -0
- package/dist/shared-DTMVoS-y.d.ts +749 -0
- package/dist/shared-Dju99SLx.d.cts +749 -0
- package/dist/shared-u-KYXAax.cjs +1394 -0
- package/dist/shared.cjs +40 -0
- package/dist/shared.d.cts +2 -0
- package/dist/shared.d.ts +2 -0
- package/dist/shared.js +1 -0
- package/dist/typed-array-BWH0IKxT.js +72 -0
- package/dist/typed-array-BkSwWNFI.cjs +101 -0
- package/dist/validator-CxDhXc0k.d.cts +28 -0
- package/dist/validator-CxDhXc0k.d.ts +28 -0
- package/dist/validator.cjs +54 -0
- package/dist/validator.d.cts +2 -0
- package/dist/validator.d.ts +2 -0
- package/dist/validator.js +45 -0
- package/dist/write-B_hZaAwC.js +2354 -0
- package/dist/write-C0KqlAXN.d.ts +86 -0
- package/dist/write-CMi0CxOu.cjs +2425 -0
- package/dist/write-KxJKA4_p.d.cts +86 -0
- package/dist/write.cjs +54 -0
- package/dist/write.d.cts +4 -0
- package/dist/write.d.ts +4 -0
- package/dist/write.js +3 -0
- package/package.json +97 -1
|
@@ -0,0 +1,1410 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
let src_core_validator = require("./validator.cjs");
|
|
24
|
+
src_core_validator = __toESM(src_core_validator, 1);
|
|
25
|
+
//#region src/core/constructors.ts
|
|
26
|
+
const PROMISE_CONSTRUCTOR = () => {
|
|
27
|
+
const resolver = {
|
|
28
|
+
p: 0,
|
|
29
|
+
s: 0,
|
|
30
|
+
f: 0
|
|
31
|
+
};
|
|
32
|
+
resolver.p = new Promise((resolve, reject) => {
|
|
33
|
+
resolver.s = resolve;
|
|
34
|
+
resolver.f = reject;
|
|
35
|
+
});
|
|
36
|
+
return resolver;
|
|
37
|
+
};
|
|
38
|
+
const PROMISE_SUCCESS = (resolver, data) => {
|
|
39
|
+
resolver.s(data);
|
|
40
|
+
resolver.p.s = 1;
|
|
41
|
+
resolver.p.v = data;
|
|
42
|
+
};
|
|
43
|
+
const PROMISE_FAILURE = (resolver, data) => {
|
|
44
|
+
resolver.f(data);
|
|
45
|
+
resolver.p.s = 2;
|
|
46
|
+
resolver.p.v = data;
|
|
47
|
+
};
|
|
48
|
+
const SERIALIZED_PROMISE_CONSTRUCTOR = /* @__PURE__ */ PROMISE_CONSTRUCTOR.toString();
|
|
49
|
+
const SERIALIZED_PROMISE_SUCCESS = /* @__PURE__ */ PROMISE_SUCCESS.toString();
|
|
50
|
+
const SERIALIZED_PROMISE_FAILURE = /* @__PURE__ */ PROMISE_FAILURE.toString();
|
|
51
|
+
const STREAM_CONSTRUCTOR = (live) => {
|
|
52
|
+
const buffer = [];
|
|
53
|
+
const listeners = [];
|
|
54
|
+
let alive = true;
|
|
55
|
+
let success = false;
|
|
56
|
+
let count = 0;
|
|
57
|
+
const internal = {
|
|
58
|
+
flush(value, mode, x) {
|
|
59
|
+
live > 1 || buffer.push(value);
|
|
60
|
+
for (x = 0; x < count; x++) {
|
|
61
|
+
const listener = listeners[x];
|
|
62
|
+
if (listener) listener[mode](value);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
up(listener, x, z, current) {
|
|
66
|
+
for (x = 0, z = buffer.length; x < z; x++) {
|
|
67
|
+
current = buffer[x];
|
|
68
|
+
if (!alive && x === z - 1) listener[success ? "return" : "throw"](current);
|
|
69
|
+
else listener.next(current);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
on(listener, temp = 0) {
|
|
73
|
+
if (live > 1) throw new Error("Stream consumed");
|
|
74
|
+
let subscribed = alive;
|
|
75
|
+
if (alive) {
|
|
76
|
+
for (temp = 0; temp < count; temp++) if (!listeners[temp]) break;
|
|
77
|
+
if (temp === count) count++;
|
|
78
|
+
listeners[temp] = listener;
|
|
79
|
+
}
|
|
80
|
+
internal.up(listener);
|
|
81
|
+
if (live) {
|
|
82
|
+
live = 2;
|
|
83
|
+
buffer.length = 0;
|
|
84
|
+
}
|
|
85
|
+
return () => {
|
|
86
|
+
if (alive && subscribed) {
|
|
87
|
+
subscribed = false;
|
|
88
|
+
listeners[temp] = void 0;
|
|
89
|
+
while (count > 0 && !listeners[count - 1]) count--;
|
|
90
|
+
listeners.length = count;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
__SEROVAL_STREAM__: true,
|
|
97
|
+
on(listener) {
|
|
98
|
+
return internal.on(listener);
|
|
99
|
+
},
|
|
100
|
+
next(value) {
|
|
101
|
+
if (alive) internal.flush(value, "next");
|
|
102
|
+
},
|
|
103
|
+
throw(value) {
|
|
104
|
+
if (alive) {
|
|
105
|
+
internal.flush(value, "throw");
|
|
106
|
+
alive = false;
|
|
107
|
+
success = false;
|
|
108
|
+
listeners.length = 0;
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
return(value) {
|
|
112
|
+
if (alive) {
|
|
113
|
+
internal.flush(value, "return");
|
|
114
|
+
alive = false;
|
|
115
|
+
success = true;
|
|
116
|
+
listeners.length = 0;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
const SERIALIZED_STREAM_CONSTRUCTOR = /* @__PURE__ */ STREAM_CONSTRUCTOR.toString();
|
|
122
|
+
const ITERATOR_CONSTRUCTOR = (symbol) => (sequence) => () => {
|
|
123
|
+
let index = 0;
|
|
124
|
+
const instance = {
|
|
125
|
+
[symbol]() {
|
|
126
|
+
return instance;
|
|
127
|
+
},
|
|
128
|
+
next() {
|
|
129
|
+
if (index > sequence.d) return {
|
|
130
|
+
done: true,
|
|
131
|
+
value: void 0
|
|
132
|
+
};
|
|
133
|
+
const currentIndex = index++;
|
|
134
|
+
const data = sequence.v[currentIndex];
|
|
135
|
+
if (currentIndex === sequence.t) throw data;
|
|
136
|
+
return {
|
|
137
|
+
done: currentIndex === sequence.d,
|
|
138
|
+
value: data
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
return instance;
|
|
143
|
+
};
|
|
144
|
+
const SERIALIZED_ITERATOR_CONSTRUCTOR = /* @__PURE__ */ ITERATOR_CONSTRUCTOR.toString();
|
|
145
|
+
const ASYNC_ITERATOR_CONSTRUCTOR = (symbol, createPromise) => (stream) => () => {
|
|
146
|
+
let count = 0;
|
|
147
|
+
let doneAt = -1;
|
|
148
|
+
let isThrow = false;
|
|
149
|
+
const buffer = [];
|
|
150
|
+
const pending = [];
|
|
151
|
+
const internal = { finalize(i = 0, len = pending.length) {
|
|
152
|
+
for (; i < len; i++) pending[i].s({
|
|
153
|
+
done: true,
|
|
154
|
+
value: void 0
|
|
155
|
+
});
|
|
156
|
+
} };
|
|
157
|
+
stream.on({
|
|
158
|
+
next(value) {
|
|
159
|
+
const temp = pending.shift();
|
|
160
|
+
if (temp) temp.s({
|
|
161
|
+
done: false,
|
|
162
|
+
value
|
|
163
|
+
});
|
|
164
|
+
buffer.push(value);
|
|
165
|
+
},
|
|
166
|
+
throw(value) {
|
|
167
|
+
const temp = pending.shift();
|
|
168
|
+
if (temp) temp.f(value);
|
|
169
|
+
internal.finalize();
|
|
170
|
+
doneAt = buffer.length;
|
|
171
|
+
isThrow = true;
|
|
172
|
+
buffer.push(value);
|
|
173
|
+
},
|
|
174
|
+
return(value) {
|
|
175
|
+
const temp = pending.shift();
|
|
176
|
+
if (temp) temp.s({
|
|
177
|
+
done: true,
|
|
178
|
+
value
|
|
179
|
+
});
|
|
180
|
+
internal.finalize();
|
|
181
|
+
doneAt = buffer.length;
|
|
182
|
+
buffer.push(value);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
const instance = {
|
|
186
|
+
[symbol]() {
|
|
187
|
+
return instance;
|
|
188
|
+
},
|
|
189
|
+
next() {
|
|
190
|
+
if (doneAt === -1) {
|
|
191
|
+
const index = count++;
|
|
192
|
+
if (index >= buffer.length) {
|
|
193
|
+
const temp = createPromise();
|
|
194
|
+
pending.push(temp);
|
|
195
|
+
return temp.p;
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
done: false,
|
|
199
|
+
value: buffer[index]
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
if (count > doneAt) return {
|
|
203
|
+
done: true,
|
|
204
|
+
value: void 0
|
|
205
|
+
};
|
|
206
|
+
const index = count++;
|
|
207
|
+
const value = buffer[index];
|
|
208
|
+
if (index !== doneAt) return {
|
|
209
|
+
done: false,
|
|
210
|
+
value
|
|
211
|
+
};
|
|
212
|
+
if (isThrow) throw value;
|
|
213
|
+
return {
|
|
214
|
+
done: true,
|
|
215
|
+
value
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
return instance;
|
|
220
|
+
};
|
|
221
|
+
const SERIALIZED_ASYNC_ITERATOR_CONSTRUCTOR = /* @__PURE__ */ ASYNC_ITERATOR_CONSTRUCTOR.toString();
|
|
222
|
+
const ARRAY_BUFFER_CONSTRUCTOR = (b64) => {
|
|
223
|
+
const decoded = atob(b64);
|
|
224
|
+
const length = decoded.length;
|
|
225
|
+
const arr = new Uint8Array(length);
|
|
226
|
+
for (let i = 0; i < length; i++) arr[i] = decoded.charCodeAt(i);
|
|
227
|
+
return arr.buffer;
|
|
228
|
+
};
|
|
229
|
+
const SERIALIZED_ARRAY_BUFFER_CONSTRUCTOR = /* @__PURE__ */ ARRAY_BUFFER_CONSTRUCTOR.toString();
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/core/compat.ts
|
|
232
|
+
/**
|
|
233
|
+
* Public feature bits for `disabledFeatures`. Stays a runtime `enum` so the
|
|
234
|
+
* published declaration is unchanged for consumers. Its values must match
|
|
235
|
+
* the internal bits (checked by test/feature.test.ts).
|
|
236
|
+
*/
|
|
237
|
+
let Feature = /* @__PURE__ */ function(Feature) {
|
|
238
|
+
Feature[Feature["AggregateError"] = 1] = "AggregateError";
|
|
239
|
+
/**
|
|
240
|
+
* @deprecated Has no effect. Output follows the syntax of the build seroval
|
|
241
|
+
* runs in: arrow functions, or `function` expressions in an ES5 build.
|
|
242
|
+
*/
|
|
243
|
+
Feature[Feature["ArrowFunction"] = 2] = "ArrowFunction";
|
|
244
|
+
Feature[Feature["ErrorPrototypeStack"] = 4] = "ErrorPrototypeStack";
|
|
245
|
+
Feature[Feature["ObjectAssign"] = 8] = "ObjectAssign";
|
|
246
|
+
Feature[Feature["BigIntTypedArray"] = 16] = "BigIntTypedArray";
|
|
247
|
+
Feature[Feature["RegExp"] = 32] = "RegExp";
|
|
248
|
+
Feature[Feature["Temporal"] = 64] = "Temporal";
|
|
249
|
+
return Feature;
|
|
250
|
+
}({});
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/core/symbols.ts
|
|
253
|
+
const SYM_ASYNC_ITERATOR = Symbol.asyncIterator;
|
|
254
|
+
const SYM_HAS_INSTANCE = Symbol.hasInstance;
|
|
255
|
+
const SYM_IS_CONCAT_SPREADABLE = Symbol.isConcatSpreadable;
|
|
256
|
+
const SYM_ITERATOR = Symbol.iterator;
|
|
257
|
+
const SYM_MATCH = Symbol.match;
|
|
258
|
+
const SYM_MATCH_ALL = Symbol.matchAll;
|
|
259
|
+
const SYM_REPLACE = Symbol.replace;
|
|
260
|
+
const SYM_SEARCH = Symbol.search;
|
|
261
|
+
const SYM_SPECIES = Symbol.species;
|
|
262
|
+
const SYM_SPLIT = Symbol.split;
|
|
263
|
+
const SYM_TO_PRIMITIVE = Symbol.toPrimitive;
|
|
264
|
+
const SYM_TO_STRING_TAG = Symbol.toStringTag;
|
|
265
|
+
const SYM_UNSCOPABLES = Symbol.unscopables;
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region src/core/constants.ts
|
|
268
|
+
const TEMPORAL_TYPE_NAME = {
|
|
269
|
+
[0]: "Instant",
|
|
270
|
+
[1]: "Duration",
|
|
271
|
+
[2]: "PlainDate",
|
|
272
|
+
[3]: "PlainDateTime",
|
|
273
|
+
[4]: "PlainMonthDay",
|
|
274
|
+
[5]: "PlainTime",
|
|
275
|
+
[6]: "PlainYearMonth",
|
|
276
|
+
[7]: "ZonedDateTime"
|
|
277
|
+
};
|
|
278
|
+
const SYMBOL_REF = {
|
|
279
|
+
[0]: SYM_ASYNC_ITERATOR,
|
|
280
|
+
[1]: SYM_HAS_INSTANCE,
|
|
281
|
+
[2]: SYM_IS_CONCAT_SPREADABLE,
|
|
282
|
+
[3]: SYM_ITERATOR,
|
|
283
|
+
[4]: SYM_MATCH,
|
|
284
|
+
[5]: SYM_MATCH_ALL,
|
|
285
|
+
[6]: SYM_REPLACE,
|
|
286
|
+
[7]: SYM_SEARCH,
|
|
287
|
+
[8]: SYM_SPECIES,
|
|
288
|
+
[9]: SYM_SPLIT,
|
|
289
|
+
[10]: SYM_TO_PRIMITIVE,
|
|
290
|
+
[11]: SYM_TO_STRING_TAG,
|
|
291
|
+
[12]: SYM_UNSCOPABLES
|
|
292
|
+
};
|
|
293
|
+
function createSymbolStringTable() {
|
|
294
|
+
const result = {};
|
|
295
|
+
for (let i = 0; i <= 12; i++) result[i] = SYMBOL_REF[i].description;
|
|
296
|
+
return result;
|
|
297
|
+
}
|
|
298
|
+
const SYMBOL_STRING = /* @__PURE__ */ createSymbolStringTable();
|
|
299
|
+
function createInverseSymbolTable() {
|
|
300
|
+
const result = {};
|
|
301
|
+
for (let i = 0; i <= 12; i++) result[SYMBOL_REF[i]] = i;
|
|
302
|
+
return result;
|
|
303
|
+
}
|
|
304
|
+
const INV_SYMBOL_REF = /* @__PURE__ */ createInverseSymbolTable();
|
|
305
|
+
const CONSTANT_STRING = {
|
|
306
|
+
[2]: "!0",
|
|
307
|
+
[3]: "!1",
|
|
308
|
+
[1]: "void 0",
|
|
309
|
+
[0]: "null",
|
|
310
|
+
[4]: "-0",
|
|
311
|
+
[5]: "1/0",
|
|
312
|
+
[6]: "-1/0",
|
|
313
|
+
[7]: "0/0"
|
|
314
|
+
};
|
|
315
|
+
const CONSTANT_VAL = {
|
|
316
|
+
[2]: true,
|
|
317
|
+
[3]: false,
|
|
318
|
+
[1]: void 0,
|
|
319
|
+
[0]: null,
|
|
320
|
+
[4]: -0,
|
|
321
|
+
[5]: Infinity,
|
|
322
|
+
[6]: -Infinity,
|
|
323
|
+
[7]: NaN
|
|
324
|
+
};
|
|
325
|
+
const ERROR_CONSTRUCTOR = {
|
|
326
|
+
[0]: Error,
|
|
327
|
+
[1]: EvalError,
|
|
328
|
+
[2]: RangeError,
|
|
329
|
+
[3]: ReferenceError,
|
|
330
|
+
[4]: SyntaxError,
|
|
331
|
+
[5]: TypeError,
|
|
332
|
+
[6]: URIError
|
|
333
|
+
};
|
|
334
|
+
function createErrorConstructorStringTable() {
|
|
335
|
+
const result = {};
|
|
336
|
+
for (let i = 0; i <= 6; i++) result[i] = ERROR_CONSTRUCTOR[i].name;
|
|
337
|
+
return result;
|
|
338
|
+
}
|
|
339
|
+
const ERROR_CONSTRUCTOR_STRING = /* @__PURE__ */ createErrorConstructorStringTable();
|
|
340
|
+
//#endregion
|
|
341
|
+
//#region src/core/string.ts
|
|
342
|
+
const MIN_JSON_STRINGIFY_LENGTH = 64;
|
|
343
|
+
const NEEDS_ESCAPE = /["\\\n\r\b\t\f<\u2028\u2029]/;
|
|
344
|
+
const JSON_ESCAPE_DIFFERENCES = /[\x00-\x07\x0b\x0e-\x1f\ud800-\udfff]/;
|
|
345
|
+
const LESS_THAN = /</g;
|
|
346
|
+
const LINE_SEPARATOR = /\u2028/g;
|
|
347
|
+
const PARAGRAPH_SEPARATOR = /\u2029/g;
|
|
348
|
+
function escapeCharCode(code) {
|
|
349
|
+
switch (code) {
|
|
350
|
+
case 34: return "\\\"";
|
|
351
|
+
case 92: return "\\\\";
|
|
352
|
+
case 10: return "\\n";
|
|
353
|
+
case 13: return "\\r";
|
|
354
|
+
case 8: return "\\b";
|
|
355
|
+
case 9: return "\\t";
|
|
356
|
+
case 12: return "\\f";
|
|
357
|
+
case 60: return "\\x3C";
|
|
358
|
+
case 8232: return "\\u2028";
|
|
359
|
+
case 8233: return "\\u2029";
|
|
360
|
+
default: return;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
function serializeString(input) {
|
|
364
|
+
const str = "" + input;
|
|
365
|
+
if (!NEEDS_ESCAPE.test(str)) return str;
|
|
366
|
+
if (str.length >= MIN_JSON_STRINGIFY_LENGTH && !JSON_ESCAPE_DIFFERENCES.test(str)) {
|
|
367
|
+
let result = JSON.stringify(str).slice(1, -1);
|
|
368
|
+
if (result.includes("<")) result = result.replace(LESS_THAN, "\\x3C");
|
|
369
|
+
if (result.includes("\u2028")) result = result.replace(LINE_SEPARATOR, "\\u2028");
|
|
370
|
+
if (result.includes("\u2029")) result = result.replace(PARAGRAPH_SEPARATOR, "\\u2029");
|
|
371
|
+
return result;
|
|
372
|
+
}
|
|
373
|
+
let result = "";
|
|
374
|
+
let lastPos = 0;
|
|
375
|
+
let replacement;
|
|
376
|
+
for (let i = 0, len = str.length; i < len; i++) {
|
|
377
|
+
replacement = escapeCharCode(str.charCodeAt(i));
|
|
378
|
+
if (replacement) {
|
|
379
|
+
result += str.slice(lastPos, i) + replacement;
|
|
380
|
+
lastPos = i + 1;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return result + str.slice(lastPos);
|
|
384
|
+
}
|
|
385
|
+
const JSON_COMPATIBLE = /^(?:[^"\\\x00-\x1f]|\\["\\nrbtf])*$/;
|
|
386
|
+
const ESCAPE_SEQUENCE = /(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g;
|
|
387
|
+
function deserializeString(str) {
|
|
388
|
+
if (typeof str !== "string") return str.replace(ESCAPE_SEQUENCE, deserializeString);
|
|
389
|
+
let index = str.indexOf("\\");
|
|
390
|
+
if (index === -1) return str;
|
|
391
|
+
if (JSON_COMPATIBLE.test(str)) return JSON.parse("\"" + str + "\"");
|
|
392
|
+
let result = "";
|
|
393
|
+
let lastPos = 0;
|
|
394
|
+
const last = str.length - 1;
|
|
395
|
+
while (index !== -1 && index < last) {
|
|
396
|
+
let replacement;
|
|
397
|
+
let length = 2;
|
|
398
|
+
switch (str.charCodeAt(index + 1)) {
|
|
399
|
+
case 92:
|
|
400
|
+
replacement = "\\";
|
|
401
|
+
break;
|
|
402
|
+
case 34:
|
|
403
|
+
replacement = "\"";
|
|
404
|
+
break;
|
|
405
|
+
case 110:
|
|
406
|
+
replacement = "\n";
|
|
407
|
+
break;
|
|
408
|
+
case 114:
|
|
409
|
+
replacement = "\r";
|
|
410
|
+
break;
|
|
411
|
+
case 98:
|
|
412
|
+
replacement = "\b";
|
|
413
|
+
break;
|
|
414
|
+
case 116:
|
|
415
|
+
replacement = " ";
|
|
416
|
+
break;
|
|
417
|
+
case 102:
|
|
418
|
+
replacement = "\f";
|
|
419
|
+
break;
|
|
420
|
+
case 120:
|
|
421
|
+
if (str.startsWith("3C", index + 2)) {
|
|
422
|
+
replacement = "<";
|
|
423
|
+
length = 4;
|
|
424
|
+
}
|
|
425
|
+
break;
|
|
426
|
+
case 117: if (str.startsWith("2028", index + 2)) {
|
|
427
|
+
replacement = "\u2028";
|
|
428
|
+
length = 6;
|
|
429
|
+
} else if (str.startsWith("2029", index + 2)) {
|
|
430
|
+
replacement = "\u2029";
|
|
431
|
+
length = 6;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
if (replacement) {
|
|
435
|
+
result += str.slice(lastPos, index) + replacement;
|
|
436
|
+
lastPos = index + length;
|
|
437
|
+
index = str.indexOf("\\", lastPos);
|
|
438
|
+
} else index = str.indexOf("\\", index + 1);
|
|
439
|
+
}
|
|
440
|
+
return result + str.slice(lastPos);
|
|
441
|
+
}
|
|
442
|
+
//#endregion
|
|
443
|
+
//#region src/core/errors.ts
|
|
444
|
+
function objectToString(value) {
|
|
445
|
+
return Object.prototype.toString.call(value);
|
|
446
|
+
}
|
|
447
|
+
function getErrorMessageDev(type, cause) {
|
|
448
|
+
if (cause instanceof Error) return `Seroval caught an error during the ${type} process.
|
|
449
|
+
|
|
450
|
+
${cause.name}
|
|
451
|
+
${cause.message}
|
|
452
|
+
|
|
453
|
+
- For more information, please check the "cause" property of this error.
|
|
454
|
+
- If you believe this is an error in Seroval, please submit an issue at https://github.com/lxsmnsyc/seroval/issues/new`;
|
|
455
|
+
return `Seroval caught an error during the ${type} process.
|
|
456
|
+
|
|
457
|
+
"${objectToString(cause)}"
|
|
458
|
+
|
|
459
|
+
For more information, please check the "cause" property of this error.`;
|
|
460
|
+
}
|
|
461
|
+
var SerovalError = class extends Error {
|
|
462
|
+
constructor(type, cause) {
|
|
463
|
+
super(getErrorMessageDev(type, cause));
|
|
464
|
+
this.cause = cause;
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
var SerovalParserError = class extends SerovalError {
|
|
468
|
+
constructor(cause) {
|
|
469
|
+
super("parsing", cause);
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
var SerovalSerializationError = class extends SerovalError {
|
|
473
|
+
constructor(cause) {
|
|
474
|
+
super("serialization", cause);
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
var SerovalDeserializationError = class extends SerovalError {
|
|
478
|
+
constructor(cause) {
|
|
479
|
+
super("deserialization", cause);
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
var SerovalUnsupportedTypeError = class extends Error {
|
|
483
|
+
constructor(value) {
|
|
484
|
+
super(`The value ${objectToString(value)} of type "${typeof value}" cannot be parsed/serialized.
|
|
485
|
+
|
|
486
|
+
There are few workarounds for this problem:
|
|
487
|
+
- Transform the value in a way that it can be serialized.
|
|
488
|
+
- If the reference is present on multiple runtimes (isomorphic), you can use the Reference API to map the references.`);
|
|
489
|
+
this.value = value;
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
var SerovalUnsupportedNodeError = class extends Error {
|
|
493
|
+
constructor(node) {
|
|
494
|
+
super("Unsupported node type \"" + node.t + "\".");
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
var SerovalMissingPluginError = class extends Error {
|
|
498
|
+
constructor(tag) {
|
|
499
|
+
super("Missing plugin for tag \"" + tag + "\".");
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
var SerovalPluginValidationError = class extends Error {
|
|
503
|
+
constructor(tag, field) {
|
|
504
|
+
super("Plugin \"" + tag + "\" received a value for \"" + field + "\" that failed its validator.");
|
|
505
|
+
this.tag = tag;
|
|
506
|
+
this.field = field;
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
var SerovalMissingInstanceError = class extends Error {
|
|
510
|
+
constructor(tag) {
|
|
511
|
+
super("Missing \"" + tag + "\" instance.");
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
/**
|
|
515
|
+
* @deprecated Not thrown by seroval. A missing `createReference` key throws
|
|
516
|
+
* {@link SerovalMissingReferenceForIdError} instead.
|
|
517
|
+
*/
|
|
518
|
+
var SerovalMissingReferenceError = class extends Error {
|
|
519
|
+
constructor(value) {
|
|
520
|
+
super("Missing reference for the value \"" + objectToString(value) + "\" of type \"" + typeof value + "\"");
|
|
521
|
+
this.value = value;
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
var SerovalMissingReferenceForIdError = class extends Error {
|
|
525
|
+
constructor(id) {
|
|
526
|
+
super("Missing reference for id \"" + serializeString(id) + "\"");
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
var SerovalUnknownTypedArrayError = class extends Error {
|
|
530
|
+
constructor(name) {
|
|
531
|
+
super("Unknown TypedArray \"" + name + "\"");
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
var SerovalMalformedNodeError = class extends Error {
|
|
535
|
+
constructor(node) {
|
|
536
|
+
super("Malformed node type \"" + node.t + "\".");
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
var SerovalConflictedNodeIdError = class extends Error {
|
|
540
|
+
constructor(node) {
|
|
541
|
+
super("Conflicted node id \"" + node.i + "\".");
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
var SerovalDepthLimitError = class extends Error {
|
|
545
|
+
constructor(limit) {
|
|
546
|
+
super("Depth limit of " + limit + " reached");
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
var SerovalAbortedError = class extends Error {
|
|
550
|
+
constructor() {
|
|
551
|
+
super("Cross deserializer has been aborted.");
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
const LIVE_STREAM_ERROR_MESSAGES = {
|
|
555
|
+
consumed: "Live stream already has a consumer",
|
|
556
|
+
pending: "Live stream already has a pending event",
|
|
557
|
+
reading: "Live stream already has a pending read",
|
|
558
|
+
closed: "Live stream is closed"
|
|
559
|
+
};
|
|
560
|
+
var SerovalLiveStreamError = class extends Error {
|
|
561
|
+
constructor(reason) {
|
|
562
|
+
super(LIVE_STREAM_ERROR_MESSAGES[reason]);
|
|
563
|
+
this.reason = reason;
|
|
564
|
+
}
|
|
565
|
+
};
|
|
566
|
+
//#endregion
|
|
567
|
+
//#region src/core/keys.ts
|
|
568
|
+
const REFERENCES_KEY = "__SEROVAL_REFS__";
|
|
569
|
+
const GLOBAL_CONTEXT_R = `self.\$R`;
|
|
570
|
+
function getCrossReferenceHeader(id) {
|
|
571
|
+
if (id == null) return `${GLOBAL_CONTEXT_R}=${GLOBAL_CONTEXT_R}||[]`;
|
|
572
|
+
return `(${GLOBAL_CONTEXT_R}=${GLOBAL_CONTEXT_R}||{})["${serializeString(id)}"]=[]`;
|
|
573
|
+
}
|
|
574
|
+
//#endregion
|
|
575
|
+
//#region src/core/reference.ts
|
|
576
|
+
const REFERENCE = /* @__PURE__ */ new Map();
|
|
577
|
+
const INV_REFERENCE = /* @__PURE__ */ new Map();
|
|
578
|
+
let installed = false;
|
|
579
|
+
function getGlobalObject() {
|
|
580
|
+
if (typeof globalThis !== "undefined") return globalThis;
|
|
581
|
+
if (typeof window !== "undefined") return window;
|
|
582
|
+
if (typeof self !== "undefined") return self;
|
|
583
|
+
if (typeof global !== "undefined") return global;
|
|
584
|
+
}
|
|
585
|
+
function installReferenceStore() {
|
|
586
|
+
if (!installed) {
|
|
587
|
+
installed = true;
|
|
588
|
+
const globalObject = getGlobalObject();
|
|
589
|
+
if (globalObject) Object.defineProperty(globalObject, REFERENCES_KEY, {
|
|
590
|
+
value: INV_REFERENCE,
|
|
591
|
+
configurable: true,
|
|
592
|
+
writable: false,
|
|
593
|
+
enumerable: false
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
function createReference(id, value) {
|
|
598
|
+
installReferenceStore();
|
|
599
|
+
REFERENCE.set(value, id);
|
|
600
|
+
INV_REFERENCE.set(id, value);
|
|
601
|
+
return value;
|
|
602
|
+
}
|
|
603
|
+
function hasReference(id) {
|
|
604
|
+
return INV_REFERENCE.has(id);
|
|
605
|
+
}
|
|
606
|
+
function getReferenceID(value) {
|
|
607
|
+
return REFERENCE.get(value);
|
|
608
|
+
}
|
|
609
|
+
function getReference(id) {
|
|
610
|
+
if (hasReference(id)) return INV_REFERENCE.get(id);
|
|
611
|
+
throw new SerovalMissingReferenceForIdError(id);
|
|
612
|
+
}
|
|
613
|
+
//#endregion
|
|
614
|
+
//#region src/core/sequence.ts
|
|
615
|
+
/**
|
|
616
|
+
* An internal class rather than a tagged POJO: identity is checked with
|
|
617
|
+
* `instanceof`, which untrusted input cannot forge. The class is exported
|
|
618
|
+
* because bundlers cannot drop an unexported top-level class.
|
|
619
|
+
* The eval-based `deserialize` path still rebuilds a `{__SEROVAL_SEQUENCE__…}`
|
|
620
|
+
* POJO from embedded source - it has no access to this class - so a value read
|
|
621
|
+
* back through `deserialize` is not an instance and, by design, is not treated
|
|
622
|
+
* as a genuine Sequence on re-serialization.
|
|
623
|
+
*/
|
|
624
|
+
var Sequence = class {
|
|
625
|
+
constructor(values, throwAt, doneAt) {
|
|
626
|
+
this.v = values;
|
|
627
|
+
this.t = throwAt;
|
|
628
|
+
this.d = doneAt;
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
function isSequence(value) {
|
|
632
|
+
return value instanceof Sequence;
|
|
633
|
+
}
|
|
634
|
+
function createSequence(values, throwAt, doneAt) {
|
|
635
|
+
return new Sequence(values, throwAt, doneAt);
|
|
636
|
+
}
|
|
637
|
+
function createSequenceFromIterable(source) {
|
|
638
|
+
const values = [];
|
|
639
|
+
let throwsAt = -1;
|
|
640
|
+
let doneAt = -1;
|
|
641
|
+
const iterator = source[SYM_ITERATOR]();
|
|
642
|
+
for (;;) try {
|
|
643
|
+
const value = iterator.next();
|
|
644
|
+
values.push(value.value);
|
|
645
|
+
if (value.done) {
|
|
646
|
+
doneAt = values.length - 1;
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
649
|
+
} catch (error) {
|
|
650
|
+
throwsAt = values.length;
|
|
651
|
+
doneAt = throwsAt;
|
|
652
|
+
values.push(error);
|
|
653
|
+
break;
|
|
654
|
+
}
|
|
655
|
+
return createSequence(values, throwsAt, doneAt);
|
|
656
|
+
}
|
|
657
|
+
const createIterator = /* @__PURE__ */ ITERATOR_CONSTRUCTOR(SYM_ITERATOR);
|
|
658
|
+
function sequenceToIterator(sequence) {
|
|
659
|
+
return createIterator(sequence);
|
|
660
|
+
}
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region src/core/live-stream.ts
|
|
663
|
+
const BRAND = /* @__PURE__ */ Symbol("LiveStream");
|
|
664
|
+
function isLiveStream(value) {
|
|
665
|
+
return value != null && value[BRAND] === true;
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* A single-consumer stream for incremental serialization. Unlike
|
|
669
|
+
* `createStream`, it keeps no history: at most one event is held, and the
|
|
670
|
+
* producer operation that sent it settles only when the consumer accepts it.
|
|
671
|
+
*
|
|
672
|
+
* An internal class rather than a tagged POJO: identity is checked with
|
|
673
|
+
* `isLiveStream`, which untrusted input cannot forge. The class is exported
|
|
674
|
+
* because bundlers cannot drop an unexported top-level class.
|
|
675
|
+
*/
|
|
676
|
+
var LiveStream = class {
|
|
677
|
+
constructor(options) {
|
|
678
|
+
this[BRAND] = true;
|
|
679
|
+
this.consumed = false;
|
|
680
|
+
this.closed = false;
|
|
681
|
+
this.cancelled = false;
|
|
682
|
+
this.options = options;
|
|
683
|
+
}
|
|
684
|
+
deliver(reader, record) {
|
|
685
|
+
record.delivered = true;
|
|
686
|
+
reader.resolve({
|
|
687
|
+
event: record.event,
|
|
688
|
+
accept: () => {
|
|
689
|
+
if (this.pending === record && record.delivered) {
|
|
690
|
+
const terminal = record.event.type !== "next";
|
|
691
|
+
record.event = void 0;
|
|
692
|
+
this.pending = void 0;
|
|
693
|
+
const resolve = record.resolve;
|
|
694
|
+
record.resolve = void 0;
|
|
695
|
+
record.reject = void 0;
|
|
696
|
+
if (terminal) {
|
|
697
|
+
this.closed = true;
|
|
698
|
+
this.options = void 0;
|
|
699
|
+
const waiter = this.waiting;
|
|
700
|
+
this.waiting = void 0;
|
|
701
|
+
waiter?.reject(new SerovalLiveStreamError("closed"));
|
|
702
|
+
}
|
|
703
|
+
resolve?.();
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
/** @internal */
|
|
709
|
+
push(event) {
|
|
710
|
+
if (this.cancelled) return Promise.reject(this.cancelReason);
|
|
711
|
+
if (this.closed) return Promise.reject(new SerovalLiveStreamError("closed"));
|
|
712
|
+
if (this.pending) return Promise.reject(new SerovalLiveStreamError("pending"));
|
|
713
|
+
return new Promise((resolve, reject) => {
|
|
714
|
+
const record = {
|
|
715
|
+
event,
|
|
716
|
+
delivered: false,
|
|
717
|
+
resolve,
|
|
718
|
+
reject
|
|
719
|
+
};
|
|
720
|
+
this.pending = record;
|
|
721
|
+
if (this.waiting) {
|
|
722
|
+
const waiter = this.waiting;
|
|
723
|
+
this.waiting = void 0;
|
|
724
|
+
this.deliver(waiter, record);
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
cancel(reason) {
|
|
729
|
+
if (this.cancelled || this.closed) return;
|
|
730
|
+
this.cancelled = true;
|
|
731
|
+
this.cancelReason = reason;
|
|
732
|
+
const record = this.pending;
|
|
733
|
+
const waiter = this.waiting;
|
|
734
|
+
this.pending = void 0;
|
|
735
|
+
this.waiting = void 0;
|
|
736
|
+
const callbackOwner = this.options;
|
|
737
|
+
this.options = void 0;
|
|
738
|
+
if (record) {
|
|
739
|
+
record.event = void 0;
|
|
740
|
+
const reject = record.reject;
|
|
741
|
+
record.resolve = void 0;
|
|
742
|
+
record.reject = void 0;
|
|
743
|
+
reject?.(reason);
|
|
744
|
+
}
|
|
745
|
+
if (waiter) waiter.reject(reason);
|
|
746
|
+
callbackOwner?.onCancel?.(reason);
|
|
747
|
+
}
|
|
748
|
+
read() {
|
|
749
|
+
if (this.cancelled) return Promise.reject(this.cancelReason);
|
|
750
|
+
if (this.closed) return Promise.reject(new SerovalLiveStreamError("closed"));
|
|
751
|
+
if (this.waiting) return Promise.reject(new SerovalLiveStreamError("reading"));
|
|
752
|
+
return new Promise((resolve, reject) => {
|
|
753
|
+
const next = {
|
|
754
|
+
resolve,
|
|
755
|
+
reject
|
|
756
|
+
};
|
|
757
|
+
if (this.pending && !this.pending.delivered) this.deliver(next, this.pending);
|
|
758
|
+
else this.waiting = next;
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
consume() {
|
|
762
|
+
if (this.consumed) throw new SerovalLiveStreamError("consumed");
|
|
763
|
+
this.consumed = true;
|
|
764
|
+
return {
|
|
765
|
+
read: () => this.read(),
|
|
766
|
+
cancel: (reason) => this.cancel(reason)
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Consumes the stream through a replay-style listener, accepting each
|
|
771
|
+
* event as soon as it has been delivered. Use `consume` or `pump` when
|
|
772
|
+
* acceptance must wait for processing.
|
|
773
|
+
*/
|
|
774
|
+
on(listener) {
|
|
775
|
+
const wrap = (key) => (value, accept) => {
|
|
776
|
+
listener[key](value);
|
|
777
|
+
accept();
|
|
778
|
+
};
|
|
779
|
+
return this.pump({
|
|
780
|
+
next: wrap("next"),
|
|
781
|
+
throw: wrap("throw"),
|
|
782
|
+
return: wrap("return")
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* Consumes the stream into a sink that controls acceptance. Returns the
|
|
787
|
+
* cancel function.
|
|
788
|
+
* @internal
|
|
789
|
+
*/
|
|
790
|
+
pump(sink) {
|
|
791
|
+
const consumer = this.consume();
|
|
792
|
+
let current = sink;
|
|
793
|
+
function next() {
|
|
794
|
+
consumer.read().then((delivery) => {
|
|
795
|
+
const target = current;
|
|
796
|
+
if (!target) return;
|
|
797
|
+
const event = delivery.event;
|
|
798
|
+
let failure;
|
|
799
|
+
let failed = false;
|
|
800
|
+
try {
|
|
801
|
+
failure = target[event.type](event.type === "throw" ? event.error : event.value, delivery.accept);
|
|
802
|
+
} catch (error) {
|
|
803
|
+
failed = true;
|
|
804
|
+
failure = error;
|
|
805
|
+
}
|
|
806
|
+
if (failed || failure !== void 0) {
|
|
807
|
+
current = void 0;
|
|
808
|
+
try {
|
|
809
|
+
consumer.cancel(failure);
|
|
810
|
+
} finally {
|
|
811
|
+
target.done?.();
|
|
812
|
+
}
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
if (event.type === "next") {
|
|
816
|
+
next();
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
current = void 0;
|
|
820
|
+
target.done?.();
|
|
821
|
+
}, (reason) => {
|
|
822
|
+
const target = current;
|
|
823
|
+
current = void 0;
|
|
824
|
+
target?.error?.(reason);
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
next();
|
|
828
|
+
return consumer.cancel;
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
/**
|
|
832
|
+
* Creates a live stream and the producer that writes to it.
|
|
833
|
+
*/
|
|
834
|
+
function createLiveStream(options) {
|
|
835
|
+
const stream = new LiveStream(options);
|
|
836
|
+
return {
|
|
837
|
+
stream,
|
|
838
|
+
producer: {
|
|
839
|
+
write(value) {
|
|
840
|
+
return stream.push({
|
|
841
|
+
type: "next",
|
|
842
|
+
value
|
|
843
|
+
});
|
|
844
|
+
},
|
|
845
|
+
close(value) {
|
|
846
|
+
return stream.push({
|
|
847
|
+
type: "return",
|
|
848
|
+
value
|
|
849
|
+
});
|
|
850
|
+
},
|
|
851
|
+
fail(error) {
|
|
852
|
+
return stream.push({
|
|
853
|
+
type: "throw",
|
|
854
|
+
error
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
//#endregion
|
|
861
|
+
//#region src/core/stream.ts
|
|
862
|
+
/**
|
|
863
|
+
* An internal class rather than a tagged POJO: identity is checked with
|
|
864
|
+
* `instanceof`, which untrusted input cannot forge. The class is exported
|
|
865
|
+
* because bundlers cannot drop an unexported top-level class.
|
|
866
|
+
*
|
|
867
|
+
* The behavior is intentionally duplicated from `STREAM_CONSTRUCTOR`. That
|
|
868
|
+
* constructor's source is embedded verbatim into the eval-based `deserialize`
|
|
869
|
+
* output, which has no access to this class, so the two cannot be shared. A
|
|
870
|
+
* stream read back through `deserialize` is therefore a plain POJO and, by
|
|
871
|
+
* design, is not treated as a genuine Stream on re-serialization. Keep the two
|
|
872
|
+
* implementations in sync.
|
|
873
|
+
*/
|
|
874
|
+
var Stream = class {
|
|
875
|
+
constructor(live) {
|
|
876
|
+
this.buffer = [];
|
|
877
|
+
this.listeners = [];
|
|
878
|
+
this.alive = true;
|
|
879
|
+
this.success = false;
|
|
880
|
+
this.count = 0;
|
|
881
|
+
this.live = live;
|
|
882
|
+
}
|
|
883
|
+
flush(value, mode) {
|
|
884
|
+
this.live > 1 || this.buffer.push(value);
|
|
885
|
+
for (let x = 0; x < this.count; x++) this.listeners[x]?.[mode](value);
|
|
886
|
+
}
|
|
887
|
+
replay(listener) {
|
|
888
|
+
for (let x = 0, z = this.buffer.length; x < z; x++) {
|
|
889
|
+
const current = this.buffer[x];
|
|
890
|
+
if (!this.alive && x === z - 1) listener[this.success ? "return" : "throw"](current);
|
|
891
|
+
else listener.next(current);
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
on(listener) {
|
|
895
|
+
if (this.live > 1) throw new Error("Stream consumed");
|
|
896
|
+
let subscribed = this.alive;
|
|
897
|
+
let temp = 0;
|
|
898
|
+
if (subscribed) {
|
|
899
|
+
for (; temp < this.count; temp++) if (!this.listeners[temp]) break;
|
|
900
|
+
if (temp === this.count) this.count++;
|
|
901
|
+
this.listeners[temp] = listener;
|
|
902
|
+
}
|
|
903
|
+
this.replay(listener);
|
|
904
|
+
if (this.live) {
|
|
905
|
+
this.live = 2;
|
|
906
|
+
this.buffer.length = 0;
|
|
907
|
+
}
|
|
908
|
+
return () => {
|
|
909
|
+
if (this.alive && subscribed) {
|
|
910
|
+
subscribed = false;
|
|
911
|
+
this.listeners[temp] = void 0;
|
|
912
|
+
while (this.count > 0 && !this.listeners[this.count - 1]) this.count--;
|
|
913
|
+
this.listeners.length = this.count;
|
|
914
|
+
}
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* Returns the events of a stream that has ended, without subscribing, so a
|
|
919
|
+
* live receiver is not consumed. The last value is the `return` or `throw`
|
|
920
|
+
* value. Returns `undefined` while the stream is open, or when a live
|
|
921
|
+
* receiver was already consumed and has no events left.
|
|
922
|
+
* @internal
|
|
923
|
+
*/
|
|
924
|
+
endedEvents() {
|
|
925
|
+
if (this.alive || this.live > 1) return void 0;
|
|
926
|
+
return {
|
|
927
|
+
values: this.buffer.slice(),
|
|
928
|
+
success: this.success
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
next(value) {
|
|
932
|
+
if (this.alive) this.flush(value, "next");
|
|
933
|
+
}
|
|
934
|
+
throw(value) {
|
|
935
|
+
if (this.alive) {
|
|
936
|
+
this.flush(value, "throw");
|
|
937
|
+
this.alive = false;
|
|
938
|
+
this.success = false;
|
|
939
|
+
this.listeners.length = 0;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
return(value) {
|
|
943
|
+
if (this.alive) {
|
|
944
|
+
this.flush(value, "return");
|
|
945
|
+
this.alive = false;
|
|
946
|
+
this.success = true;
|
|
947
|
+
this.listeners.length = 0;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
function isStream(value) {
|
|
952
|
+
return value instanceof Stream || isLiveStream(value);
|
|
953
|
+
}
|
|
954
|
+
function createStream() {
|
|
955
|
+
return new Stream();
|
|
956
|
+
}
|
|
957
|
+
const createAsyncIterable = /* @__PURE__ */ ASYNC_ITERATOR_CONSTRUCTOR(SYM_ASYNC_ITERATOR, PROMISE_CONSTRUCTOR);
|
|
958
|
+
function streamToAsyncIterable(stream) {
|
|
959
|
+
return createAsyncIterable(stream);
|
|
960
|
+
}
|
|
961
|
+
//#endregion
|
|
962
|
+
//#region src/core/plugin.ts
|
|
963
|
+
let SerovalMode = /* @__PURE__ */ function(SerovalMode) {
|
|
964
|
+
SerovalMode[SerovalMode["Vanilla"] = 1] = "Vanilla";
|
|
965
|
+
SerovalMode[SerovalMode["Cross"] = 2] = "Cross";
|
|
966
|
+
return SerovalMode;
|
|
967
|
+
}({});
|
|
968
|
+
function createPlugin(plugin) {
|
|
969
|
+
return plugin;
|
|
970
|
+
}
|
|
971
|
+
function dedupePlugins(deduped, plugins) {
|
|
972
|
+
for (let i = 0, len = plugins.length; i < len; i++) {
|
|
973
|
+
const current = plugins[i];
|
|
974
|
+
if (!deduped.has(current)) {
|
|
975
|
+
deduped.add(current);
|
|
976
|
+
if (current.extends) dedupePlugins(deduped, current.extends);
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
const RESOLVED_PLUGINS = /* @__PURE__ */ new WeakMap();
|
|
981
|
+
function matchResolved(resolved, plugins, added) {
|
|
982
|
+
for (let i = 0, len = plugins.length; i < len; i++) {
|
|
983
|
+
const current = plugins[i];
|
|
984
|
+
if (current === resolved[added]) {
|
|
985
|
+
added++;
|
|
986
|
+
if (current.extends) {
|
|
987
|
+
added = matchResolved(resolved, current.extends, added);
|
|
988
|
+
if (added === -1) return -1;
|
|
989
|
+
}
|
|
990
|
+
} else {
|
|
991
|
+
const index = resolved.indexOf(current);
|
|
992
|
+
if (index === -1 || index >= added) return -1;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
return added;
|
|
996
|
+
}
|
|
997
|
+
function resolvePlugins(plugins) {
|
|
998
|
+
if (plugins) {
|
|
999
|
+
const cached = RESOLVED_PLUGINS.get(plugins);
|
|
1000
|
+
if (cached && matchResolved(cached, plugins, 0) === cached.length) return cached;
|
|
1001
|
+
const deduped = /* @__PURE__ */ new Set();
|
|
1002
|
+
dedupePlugins(deduped, plugins);
|
|
1003
|
+
const resolved = [...deduped];
|
|
1004
|
+
RESOLVED_PLUGINS.set(plugins, resolved);
|
|
1005
|
+
return resolved;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Returns the plugins that are tested for plain objects. It is the same array
|
|
1010
|
+
* when no plugin sets `skipPlainObjects`.
|
|
1011
|
+
*/
|
|
1012
|
+
function getPlainObjectPlugins(plugins) {
|
|
1013
|
+
if (plugins) {
|
|
1014
|
+
for (let i = 0, len = plugins.length; i < len; i++) if (plugins[i].skipPlainObjects) {
|
|
1015
|
+
const result = plugins.filter((plugin) => !plugin.skipPlainObjects);
|
|
1016
|
+
return result.length ? result : void 0;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
return plugins;
|
|
1020
|
+
}
|
|
1021
|
+
//#endregion
|
|
1022
|
+
//#region src/core/opaque-reference.ts
|
|
1023
|
+
/**
|
|
1024
|
+
* An opaque reference allows hiding values from the serializer.
|
|
1025
|
+
*/
|
|
1026
|
+
var OpaqueReference = class {
|
|
1027
|
+
constructor(value, replacement) {
|
|
1028
|
+
this.value = value;
|
|
1029
|
+
this.replacement = replacement;
|
|
1030
|
+
}
|
|
1031
|
+
};
|
|
1032
|
+
//#endregion
|
|
1033
|
+
Object.defineProperty(exports, "ARRAY_BUFFER_CONSTRUCTOR", {
|
|
1034
|
+
enumerable: true,
|
|
1035
|
+
get: function() {
|
|
1036
|
+
return ARRAY_BUFFER_CONSTRUCTOR;
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
Object.defineProperty(exports, "CONSTANT_STRING", {
|
|
1040
|
+
enumerable: true,
|
|
1041
|
+
get: function() {
|
|
1042
|
+
return CONSTANT_STRING;
|
|
1043
|
+
}
|
|
1044
|
+
});
|
|
1045
|
+
Object.defineProperty(exports, "CONSTANT_VAL", {
|
|
1046
|
+
enumerable: true,
|
|
1047
|
+
get: function() {
|
|
1048
|
+
return CONSTANT_VAL;
|
|
1049
|
+
}
|
|
1050
|
+
});
|
|
1051
|
+
Object.defineProperty(exports, "ERROR_CONSTRUCTOR", {
|
|
1052
|
+
enumerable: true,
|
|
1053
|
+
get: function() {
|
|
1054
|
+
return ERROR_CONSTRUCTOR;
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
Object.defineProperty(exports, "ERROR_CONSTRUCTOR_STRING", {
|
|
1058
|
+
enumerable: true,
|
|
1059
|
+
get: function() {
|
|
1060
|
+
return ERROR_CONSTRUCTOR_STRING;
|
|
1061
|
+
}
|
|
1062
|
+
});
|
|
1063
|
+
Object.defineProperty(exports, "Feature", {
|
|
1064
|
+
enumerable: true,
|
|
1065
|
+
get: function() {
|
|
1066
|
+
return Feature;
|
|
1067
|
+
}
|
|
1068
|
+
});
|
|
1069
|
+
Object.defineProperty(exports, "INV_SYMBOL_REF", {
|
|
1070
|
+
enumerable: true,
|
|
1071
|
+
get: function() {
|
|
1072
|
+
return INV_SYMBOL_REF;
|
|
1073
|
+
}
|
|
1074
|
+
});
|
|
1075
|
+
Object.defineProperty(exports, "LiveStream", {
|
|
1076
|
+
enumerable: true,
|
|
1077
|
+
get: function() {
|
|
1078
|
+
return LiveStream;
|
|
1079
|
+
}
|
|
1080
|
+
});
|
|
1081
|
+
Object.defineProperty(exports, "OpaqueReference", {
|
|
1082
|
+
enumerable: true,
|
|
1083
|
+
get: function() {
|
|
1084
|
+
return OpaqueReference;
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1087
|
+
Object.defineProperty(exports, "PROMISE_CONSTRUCTOR", {
|
|
1088
|
+
enumerable: true,
|
|
1089
|
+
get: function() {
|
|
1090
|
+
return PROMISE_CONSTRUCTOR;
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
Object.defineProperty(exports, "REFERENCES_KEY", {
|
|
1094
|
+
enumerable: true,
|
|
1095
|
+
get: function() {
|
|
1096
|
+
return REFERENCES_KEY;
|
|
1097
|
+
}
|
|
1098
|
+
});
|
|
1099
|
+
Object.defineProperty(exports, "SERIALIZED_ARRAY_BUFFER_CONSTRUCTOR", {
|
|
1100
|
+
enumerable: true,
|
|
1101
|
+
get: function() {
|
|
1102
|
+
return SERIALIZED_ARRAY_BUFFER_CONSTRUCTOR;
|
|
1103
|
+
}
|
|
1104
|
+
});
|
|
1105
|
+
Object.defineProperty(exports, "SERIALIZED_ASYNC_ITERATOR_CONSTRUCTOR", {
|
|
1106
|
+
enumerable: true,
|
|
1107
|
+
get: function() {
|
|
1108
|
+
return SERIALIZED_ASYNC_ITERATOR_CONSTRUCTOR;
|
|
1109
|
+
}
|
|
1110
|
+
});
|
|
1111
|
+
Object.defineProperty(exports, "SERIALIZED_ITERATOR_CONSTRUCTOR", {
|
|
1112
|
+
enumerable: true,
|
|
1113
|
+
get: function() {
|
|
1114
|
+
return SERIALIZED_ITERATOR_CONSTRUCTOR;
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
Object.defineProperty(exports, "SERIALIZED_PROMISE_CONSTRUCTOR", {
|
|
1118
|
+
enumerable: true,
|
|
1119
|
+
get: function() {
|
|
1120
|
+
return SERIALIZED_PROMISE_CONSTRUCTOR;
|
|
1121
|
+
}
|
|
1122
|
+
});
|
|
1123
|
+
Object.defineProperty(exports, "SERIALIZED_PROMISE_FAILURE", {
|
|
1124
|
+
enumerable: true,
|
|
1125
|
+
get: function() {
|
|
1126
|
+
return SERIALIZED_PROMISE_FAILURE;
|
|
1127
|
+
}
|
|
1128
|
+
});
|
|
1129
|
+
Object.defineProperty(exports, "SERIALIZED_PROMISE_SUCCESS", {
|
|
1130
|
+
enumerable: true,
|
|
1131
|
+
get: function() {
|
|
1132
|
+
return SERIALIZED_PROMISE_SUCCESS;
|
|
1133
|
+
}
|
|
1134
|
+
});
|
|
1135
|
+
Object.defineProperty(exports, "SERIALIZED_STREAM_CONSTRUCTOR", {
|
|
1136
|
+
enumerable: true,
|
|
1137
|
+
get: function() {
|
|
1138
|
+
return SERIALIZED_STREAM_CONSTRUCTOR;
|
|
1139
|
+
}
|
|
1140
|
+
});
|
|
1141
|
+
Object.defineProperty(exports, "SYMBOL_REF", {
|
|
1142
|
+
enumerable: true,
|
|
1143
|
+
get: function() {
|
|
1144
|
+
return SYMBOL_REF;
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
Object.defineProperty(exports, "SYMBOL_STRING", {
|
|
1148
|
+
enumerable: true,
|
|
1149
|
+
get: function() {
|
|
1150
|
+
return SYMBOL_STRING;
|
|
1151
|
+
}
|
|
1152
|
+
});
|
|
1153
|
+
Object.defineProperty(exports, "SYM_ASYNC_ITERATOR", {
|
|
1154
|
+
enumerable: true,
|
|
1155
|
+
get: function() {
|
|
1156
|
+
return SYM_ASYNC_ITERATOR;
|
|
1157
|
+
}
|
|
1158
|
+
});
|
|
1159
|
+
Object.defineProperty(exports, "SYM_IS_CONCAT_SPREADABLE", {
|
|
1160
|
+
enumerable: true,
|
|
1161
|
+
get: function() {
|
|
1162
|
+
return SYM_IS_CONCAT_SPREADABLE;
|
|
1163
|
+
}
|
|
1164
|
+
});
|
|
1165
|
+
Object.defineProperty(exports, "SYM_ITERATOR", {
|
|
1166
|
+
enumerable: true,
|
|
1167
|
+
get: function() {
|
|
1168
|
+
return SYM_ITERATOR;
|
|
1169
|
+
}
|
|
1170
|
+
});
|
|
1171
|
+
Object.defineProperty(exports, "SYM_TO_STRING_TAG", {
|
|
1172
|
+
enumerable: true,
|
|
1173
|
+
get: function() {
|
|
1174
|
+
return SYM_TO_STRING_TAG;
|
|
1175
|
+
}
|
|
1176
|
+
});
|
|
1177
|
+
Object.defineProperty(exports, "Sequence", {
|
|
1178
|
+
enumerable: true,
|
|
1179
|
+
get: function() {
|
|
1180
|
+
return Sequence;
|
|
1181
|
+
}
|
|
1182
|
+
});
|
|
1183
|
+
Object.defineProperty(exports, "SerovalAbortedError", {
|
|
1184
|
+
enumerable: true,
|
|
1185
|
+
get: function() {
|
|
1186
|
+
return SerovalAbortedError;
|
|
1187
|
+
}
|
|
1188
|
+
});
|
|
1189
|
+
Object.defineProperty(exports, "SerovalConflictedNodeIdError", {
|
|
1190
|
+
enumerable: true,
|
|
1191
|
+
get: function() {
|
|
1192
|
+
return SerovalConflictedNodeIdError;
|
|
1193
|
+
}
|
|
1194
|
+
});
|
|
1195
|
+
Object.defineProperty(exports, "SerovalDepthLimitError", {
|
|
1196
|
+
enumerable: true,
|
|
1197
|
+
get: function() {
|
|
1198
|
+
return SerovalDepthLimitError;
|
|
1199
|
+
}
|
|
1200
|
+
});
|
|
1201
|
+
Object.defineProperty(exports, "SerovalDeserializationError", {
|
|
1202
|
+
enumerable: true,
|
|
1203
|
+
get: function() {
|
|
1204
|
+
return SerovalDeserializationError;
|
|
1205
|
+
}
|
|
1206
|
+
});
|
|
1207
|
+
Object.defineProperty(exports, "SerovalError", {
|
|
1208
|
+
enumerable: true,
|
|
1209
|
+
get: function() {
|
|
1210
|
+
return SerovalError;
|
|
1211
|
+
}
|
|
1212
|
+
});
|
|
1213
|
+
Object.defineProperty(exports, "SerovalLiveStreamError", {
|
|
1214
|
+
enumerable: true,
|
|
1215
|
+
get: function() {
|
|
1216
|
+
return SerovalLiveStreamError;
|
|
1217
|
+
}
|
|
1218
|
+
});
|
|
1219
|
+
Object.defineProperty(exports, "SerovalMalformedNodeError", {
|
|
1220
|
+
enumerable: true,
|
|
1221
|
+
get: function() {
|
|
1222
|
+
return SerovalMalformedNodeError;
|
|
1223
|
+
}
|
|
1224
|
+
});
|
|
1225
|
+
Object.defineProperty(exports, "SerovalMissingInstanceError", {
|
|
1226
|
+
enumerable: true,
|
|
1227
|
+
get: function() {
|
|
1228
|
+
return SerovalMissingInstanceError;
|
|
1229
|
+
}
|
|
1230
|
+
});
|
|
1231
|
+
Object.defineProperty(exports, "SerovalMissingPluginError", {
|
|
1232
|
+
enumerable: true,
|
|
1233
|
+
get: function() {
|
|
1234
|
+
return SerovalMissingPluginError;
|
|
1235
|
+
}
|
|
1236
|
+
});
|
|
1237
|
+
Object.defineProperty(exports, "SerovalMissingReferenceError", {
|
|
1238
|
+
enumerable: true,
|
|
1239
|
+
get: function() {
|
|
1240
|
+
return SerovalMissingReferenceError;
|
|
1241
|
+
}
|
|
1242
|
+
});
|
|
1243
|
+
Object.defineProperty(exports, "SerovalMissingReferenceForIdError", {
|
|
1244
|
+
enumerable: true,
|
|
1245
|
+
get: function() {
|
|
1246
|
+
return SerovalMissingReferenceForIdError;
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1249
|
+
Object.defineProperty(exports, "SerovalMode", {
|
|
1250
|
+
enumerable: true,
|
|
1251
|
+
get: function() {
|
|
1252
|
+
return SerovalMode;
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1255
|
+
Object.defineProperty(exports, "SerovalParserError", {
|
|
1256
|
+
enumerable: true,
|
|
1257
|
+
get: function() {
|
|
1258
|
+
return SerovalParserError;
|
|
1259
|
+
}
|
|
1260
|
+
});
|
|
1261
|
+
Object.defineProperty(exports, "SerovalPluginValidationError", {
|
|
1262
|
+
enumerable: true,
|
|
1263
|
+
get: function() {
|
|
1264
|
+
return SerovalPluginValidationError;
|
|
1265
|
+
}
|
|
1266
|
+
});
|
|
1267
|
+
Object.defineProperty(exports, "SerovalSerializationError", {
|
|
1268
|
+
enumerable: true,
|
|
1269
|
+
get: function() {
|
|
1270
|
+
return SerovalSerializationError;
|
|
1271
|
+
}
|
|
1272
|
+
});
|
|
1273
|
+
Object.defineProperty(exports, "SerovalUnknownTypedArrayError", {
|
|
1274
|
+
enumerable: true,
|
|
1275
|
+
get: function() {
|
|
1276
|
+
return SerovalUnknownTypedArrayError;
|
|
1277
|
+
}
|
|
1278
|
+
});
|
|
1279
|
+
Object.defineProperty(exports, "SerovalUnsupportedNodeError", {
|
|
1280
|
+
enumerable: true,
|
|
1281
|
+
get: function() {
|
|
1282
|
+
return SerovalUnsupportedNodeError;
|
|
1283
|
+
}
|
|
1284
|
+
});
|
|
1285
|
+
Object.defineProperty(exports, "SerovalUnsupportedTypeError", {
|
|
1286
|
+
enumerable: true,
|
|
1287
|
+
get: function() {
|
|
1288
|
+
return SerovalUnsupportedTypeError;
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1291
|
+
Object.defineProperty(exports, "Stream", {
|
|
1292
|
+
enumerable: true,
|
|
1293
|
+
get: function() {
|
|
1294
|
+
return Stream;
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
Object.defineProperty(exports, "TEMPORAL_TYPE_NAME", {
|
|
1298
|
+
enumerable: true,
|
|
1299
|
+
get: function() {
|
|
1300
|
+
return TEMPORAL_TYPE_NAME;
|
|
1301
|
+
}
|
|
1302
|
+
});
|
|
1303
|
+
Object.defineProperty(exports, "createLiveStream", {
|
|
1304
|
+
enumerable: true,
|
|
1305
|
+
get: function() {
|
|
1306
|
+
return createLiveStream;
|
|
1307
|
+
}
|
|
1308
|
+
});
|
|
1309
|
+
Object.defineProperty(exports, "createPlugin", {
|
|
1310
|
+
enumerable: true,
|
|
1311
|
+
get: function() {
|
|
1312
|
+
return createPlugin;
|
|
1313
|
+
}
|
|
1314
|
+
});
|
|
1315
|
+
Object.defineProperty(exports, "createReference", {
|
|
1316
|
+
enumerable: true,
|
|
1317
|
+
get: function() {
|
|
1318
|
+
return createReference;
|
|
1319
|
+
}
|
|
1320
|
+
});
|
|
1321
|
+
Object.defineProperty(exports, "createSequence", {
|
|
1322
|
+
enumerable: true,
|
|
1323
|
+
get: function() {
|
|
1324
|
+
return createSequence;
|
|
1325
|
+
}
|
|
1326
|
+
});
|
|
1327
|
+
Object.defineProperty(exports, "createSequenceFromIterable", {
|
|
1328
|
+
enumerable: true,
|
|
1329
|
+
get: function() {
|
|
1330
|
+
return createSequenceFromIterable;
|
|
1331
|
+
}
|
|
1332
|
+
});
|
|
1333
|
+
Object.defineProperty(exports, "createStream", {
|
|
1334
|
+
enumerable: true,
|
|
1335
|
+
get: function() {
|
|
1336
|
+
return createStream;
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1339
|
+
Object.defineProperty(exports, "deserializeString", {
|
|
1340
|
+
enumerable: true,
|
|
1341
|
+
get: function() {
|
|
1342
|
+
return deserializeString;
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
Object.defineProperty(exports, "getCrossReferenceHeader", {
|
|
1346
|
+
enumerable: true,
|
|
1347
|
+
get: function() {
|
|
1348
|
+
return getCrossReferenceHeader;
|
|
1349
|
+
}
|
|
1350
|
+
});
|
|
1351
|
+
Object.defineProperty(exports, "getPlainObjectPlugins", {
|
|
1352
|
+
enumerable: true,
|
|
1353
|
+
get: function() {
|
|
1354
|
+
return getPlainObjectPlugins;
|
|
1355
|
+
}
|
|
1356
|
+
});
|
|
1357
|
+
Object.defineProperty(exports, "getReference", {
|
|
1358
|
+
enumerable: true,
|
|
1359
|
+
get: function() {
|
|
1360
|
+
return getReference;
|
|
1361
|
+
}
|
|
1362
|
+
});
|
|
1363
|
+
Object.defineProperty(exports, "getReferenceID", {
|
|
1364
|
+
enumerable: true,
|
|
1365
|
+
get: function() {
|
|
1366
|
+
return getReferenceID;
|
|
1367
|
+
}
|
|
1368
|
+
});
|
|
1369
|
+
Object.defineProperty(exports, "isLiveStream", {
|
|
1370
|
+
enumerable: true,
|
|
1371
|
+
get: function() {
|
|
1372
|
+
return isLiveStream;
|
|
1373
|
+
}
|
|
1374
|
+
});
|
|
1375
|
+
Object.defineProperty(exports, "isSequence", {
|
|
1376
|
+
enumerable: true,
|
|
1377
|
+
get: function() {
|
|
1378
|
+
return isSequence;
|
|
1379
|
+
}
|
|
1380
|
+
});
|
|
1381
|
+
Object.defineProperty(exports, "isStream", {
|
|
1382
|
+
enumerable: true,
|
|
1383
|
+
get: function() {
|
|
1384
|
+
return isStream;
|
|
1385
|
+
}
|
|
1386
|
+
});
|
|
1387
|
+
Object.defineProperty(exports, "resolvePlugins", {
|
|
1388
|
+
enumerable: true,
|
|
1389
|
+
get: function() {
|
|
1390
|
+
return resolvePlugins;
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
Object.defineProperty(exports, "sequenceToIterator", {
|
|
1394
|
+
enumerable: true,
|
|
1395
|
+
get: function() {
|
|
1396
|
+
return sequenceToIterator;
|
|
1397
|
+
}
|
|
1398
|
+
});
|
|
1399
|
+
Object.defineProperty(exports, "serializeString", {
|
|
1400
|
+
enumerable: true,
|
|
1401
|
+
get: function() {
|
|
1402
|
+
return serializeString;
|
|
1403
|
+
}
|
|
1404
|
+
});
|
|
1405
|
+
Object.defineProperty(exports, "streamToAsyncIterable", {
|
|
1406
|
+
enumerable: true,
|
|
1407
|
+
get: function() {
|
|
1408
|
+
return streamToAsyncIterable;
|
|
1409
|
+
}
|
|
1410
|
+
});
|