1395 lines
35 KiB
JavaScript
1395 lines
35 KiB
JavaScript
|
|
//#region \0rolldown/runtime.js
|
||
|
|
var __create = Object.create;
|
||
|
|
var __defProp = Object.defineProperty;
|
||
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||
|
|
var __getProtoOf = Object.getPrototypeOf;
|
||
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||
|
|
var __copyProps = (to, from, except, desc) => {
|
||
|
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
||
|
|
key = keys[i];
|
||
|
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
||
|
|
get: ((k) => from[k]).bind(null, key),
|
||
|
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
||
|
|
});
|
||
|
|
}
|
||
|
|
return to;
|
||
|
|
};
|
||
|
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
||
|
|
value: mod,
|
||
|
|
enumerable: true
|
||
|
|
}) : target, mod));
|
||
|
|
//#endregion
|
||
|
|
let src_core_validator = require("./validator.cjs");
|
||
|
|
src_core_validator = __toESM(src_core_validator, 1);
|
||
|
|
//#region src/core/constructors.ts
|
||
|
|
const PROMISE_CONSTRUCTOR = () => {
|
||
|
|
const resolver = {
|
||
|
|
p: 0,
|
||
|
|
s: 0,
|
||
|
|
f: 0
|
||
|
|
};
|
||
|
|
resolver.p = new Promise((resolve, reject) => {
|
||
|
|
resolver.s = resolve;
|
||
|
|
resolver.f = reject;
|
||
|
|
});
|
||
|
|
return resolver;
|
||
|
|
};
|
||
|
|
const PROMISE_SUCCESS = (resolver, data) => {
|
||
|
|
resolver.s(data);
|
||
|
|
resolver.p.s = 1;
|
||
|
|
resolver.p.v = data;
|
||
|
|
};
|
||
|
|
const PROMISE_FAILURE = (resolver, data) => {
|
||
|
|
resolver.f(data);
|
||
|
|
resolver.p.s = 2;
|
||
|
|
resolver.p.v = data;
|
||
|
|
};
|
||
|
|
const SERIALIZED_PROMISE_CONSTRUCTOR = /* @__PURE__ */ PROMISE_CONSTRUCTOR.toString();
|
||
|
|
const SERIALIZED_PROMISE_SUCCESS = /* @__PURE__ */ PROMISE_SUCCESS.toString();
|
||
|
|
const SERIALIZED_PROMISE_FAILURE = /* @__PURE__ */ PROMISE_FAILURE.toString();
|
||
|
|
const STREAM_CONSTRUCTOR = (live) => {
|
||
|
|
const buffer = [];
|
||
|
|
const listeners = [];
|
||
|
|
let alive = true;
|
||
|
|
let success = false;
|
||
|
|
let count = 0;
|
||
|
|
const internal = {
|
||
|
|
flush(value, mode, x) {
|
||
|
|
live > 1 || buffer.push(value);
|
||
|
|
for (x = 0; x < count; x++) {
|
||
|
|
const listener = listeners[x];
|
||
|
|
if (listener) listener[mode](value);
|
||
|
|
}
|
||
|
|
},
|
||
|
|
up(listener, x, z, current) {
|
||
|
|
for (x = 0, z = buffer.length; x < z; x++) {
|
||
|
|
current = buffer[x];
|
||
|
|
if (!alive && x === z - 1) listener[success ? "return" : "throw"](current);
|
||
|
|
else listener.next(current);
|
||
|
|
}
|
||
|
|
},
|
||
|
|
on(listener, temp = 0) {
|
||
|
|
if (live > 1) throw new Error("Stream consumed");
|
||
|
|
let subscribed = alive;
|
||
|
|
if (alive) {
|
||
|
|
for (temp = 0; temp < count; temp++) if (!listeners[temp]) break;
|
||
|
|
if (temp === count) count++;
|
||
|
|
listeners[temp] = listener;
|
||
|
|
}
|
||
|
|
internal.up(listener);
|
||
|
|
if (live) {
|
||
|
|
live = 2;
|
||
|
|
buffer.length = 0;
|
||
|
|
}
|
||
|
|
return () => {
|
||
|
|
if (alive && subscribed) {
|
||
|
|
subscribed = false;
|
||
|
|
listeners[temp] = void 0;
|
||
|
|
while (count > 0 && !listeners[count - 1]) count--;
|
||
|
|
listeners.length = count;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|
||
|
|
};
|
||
|
|
return {
|
||
|
|
__SEROVAL_STREAM__: true,
|
||
|
|
on(listener) {
|
||
|
|
return internal.on(listener);
|
||
|
|
},
|
||
|
|
next(value) {
|
||
|
|
if (alive) internal.flush(value, "next");
|
||
|
|
},
|
||
|
|
throw(value) {
|
||
|
|
if (alive) {
|
||
|
|
internal.flush(value, "throw");
|
||
|
|
alive = false;
|
||
|
|
success = false;
|
||
|
|
listeners.length = 0;
|
||
|
|
}
|
||
|
|
},
|
||
|
|
return(value) {
|
||
|
|
if (alive) {
|
||
|
|
internal.flush(value, "return");
|
||
|
|
alive = false;
|
||
|
|
success = true;
|
||
|
|
listeners.length = 0;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
};
|
||
|
|
};
|
||
|
|
const SERIALIZED_STREAM_CONSTRUCTOR = /* @__PURE__ */ STREAM_CONSTRUCTOR.toString();
|
||
|
|
const ITERATOR_CONSTRUCTOR = (symbol) => (sequence) => () => {
|
||
|
|
let index = 0;
|
||
|
|
const instance = {
|
||
|
|
[symbol]() {
|
||
|
|
return instance;
|
||
|
|
},
|
||
|
|
next() {
|
||
|
|
if (index > sequence.d) return {
|
||
|
|
done: true,
|
||
|
|
value: void 0
|
||
|
|
};
|
||
|
|
const currentIndex = index++;
|
||
|
|
const data = sequence.v[currentIndex];
|
||
|
|
if (currentIndex === sequence.t) throw data;
|
||
|
|
return {
|
||
|
|
done: currentIndex === sequence.d,
|
||
|
|
value: data
|
||
|
|
};
|
||
|
|
}
|
||
|
|
};
|
||
|
|
return instance;
|
||
|
|
};
|
||
|
|
const SERIALIZED_ITERATOR_CONSTRUCTOR = /* @__PURE__ */ ITERATOR_CONSTRUCTOR.toString();
|
||
|
|
const ASYNC_ITERATOR_CONSTRUCTOR = (symbol, createPromise) => (stream) => () => {
|
||
|
|
let count = 0;
|
||
|
|
let doneAt = -1;
|
||
|
|
let isThrow = false;
|
||
|
|
const buffer = [];
|
||
|
|
const pending = [];
|
||
|
|
const internal = { finalize(i = 0, len = pending.length) {
|
||
|
|
for (; i < len; i++) pending[i].s({
|
||
|
|
done: true,
|
||
|
|
value: void 0
|
||
|
|
});
|
||
|
|
} };
|
||
|
|
stream.on({
|
||
|
|
next(value) {
|
||
|
|
const temp = pending.shift();
|
||
|
|
if (temp) temp.s({
|
||
|
|
done: false,
|
||
|
|
value
|
||
|
|
});
|
||
|
|
buffer.push(value);
|
||
|
|
},
|
||
|
|
throw(value) {
|
||
|
|
const temp = pending.shift();
|
||
|
|
if (temp) temp.f(value);
|
||
|
|
internal.finalize();
|
||
|
|
doneAt = buffer.length;
|
||
|
|
isThrow = true;
|
||
|
|
buffer.push(value);
|
||
|
|
},
|
||
|
|
return(value) {
|
||
|
|
const temp = pending.shift();
|
||
|
|
if (temp) temp.s({
|
||
|
|
done: true,
|
||
|
|
value
|
||
|
|
});
|
||
|
|
internal.finalize();
|
||
|
|
doneAt = buffer.length;
|
||
|
|
buffer.push(value);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
const instance = {
|
||
|
|
[symbol]() {
|
||
|
|
return instance;
|
||
|
|
},
|
||
|
|
next() {
|
||
|
|
if (doneAt === -1) {
|
||
|
|
const index = count++;
|
||
|
|
if (index >= buffer.length) {
|
||
|
|
const temp = createPromise();
|
||
|
|
pending.push(temp);
|
||
|
|
return temp.p;
|
||
|
|
}
|
||
|
|
return {
|
||
|
|
done: false,
|
||
|
|
value: buffer[index]
|
||
|
|
};
|
||
|
|
}
|
||
|
|
if (count > doneAt) return {
|
||
|
|
done: true,
|
||
|
|
value: void 0
|
||
|
|
};
|
||
|
|
const index = count++;
|
||
|
|
const value = buffer[index];
|
||
|
|
if (index !== doneAt) return {
|
||
|
|
done: false,
|
||
|
|
value
|
||
|
|
};
|
||
|
|
if (isThrow) throw value;
|
||
|
|
return {
|
||
|
|
done: true,
|
||
|
|
value
|
||
|
|
};
|
||
|
|
}
|
||
|
|
};
|
||
|
|
return instance;
|
||
|
|
};
|
||
|
|
const SERIALIZED_ASYNC_ITERATOR_CONSTRUCTOR = /* @__PURE__ */ ASYNC_ITERATOR_CONSTRUCTOR.toString();
|
||
|
|
const ARRAY_BUFFER_CONSTRUCTOR = (b64) => {
|
||
|
|
const decoded = atob(b64);
|
||
|
|
const length = decoded.length;
|
||
|
|
const arr = new Uint8Array(length);
|
||
|
|
for (let i = 0; i < length; i++) arr[i] = decoded.charCodeAt(i);
|
||
|
|
return arr.buffer;
|
||
|
|
};
|
||
|
|
const SERIALIZED_ARRAY_BUFFER_CONSTRUCTOR = /* @__PURE__ */ ARRAY_BUFFER_CONSTRUCTOR.toString();
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/compat.ts
|
||
|
|
/**
|
||
|
|
* Public feature bits for `disabledFeatures`. Stays a runtime `enum` so the
|
||
|
|
* published declaration is unchanged for consumers. Its values must match
|
||
|
|
* the internal bits (checked by test/feature.test.ts).
|
||
|
|
*/
|
||
|
|
let Feature = /* @__PURE__ */ function(Feature) {
|
||
|
|
Feature[Feature["AggregateError"] = 1] = "AggregateError";
|
||
|
|
/**
|
||
|
|
* @deprecated Has no effect. Output follows the syntax of the build seroval
|
||
|
|
* runs in: arrow functions, or `function` expressions in an ES5 build.
|
||
|
|
*/
|
||
|
|
Feature[Feature["ArrowFunction"] = 2] = "ArrowFunction";
|
||
|
|
Feature[Feature["ErrorPrototypeStack"] = 4] = "ErrorPrototypeStack";
|
||
|
|
Feature[Feature["ObjectAssign"] = 8] = "ObjectAssign";
|
||
|
|
Feature[Feature["BigIntTypedArray"] = 16] = "BigIntTypedArray";
|
||
|
|
Feature[Feature["RegExp"] = 32] = "RegExp";
|
||
|
|
Feature[Feature["Temporal"] = 64] = "Temporal";
|
||
|
|
return Feature;
|
||
|
|
}({});
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/symbols.ts
|
||
|
|
const SYM_ASYNC_ITERATOR = Symbol.asyncIterator;
|
||
|
|
const SYM_HAS_INSTANCE = Symbol.hasInstance;
|
||
|
|
const SYM_IS_CONCAT_SPREADABLE = Symbol.isConcatSpreadable;
|
||
|
|
const SYM_ITERATOR = Symbol.iterator;
|
||
|
|
const SYM_MATCH = Symbol.match;
|
||
|
|
const SYM_MATCH_ALL = Symbol.matchAll;
|
||
|
|
const SYM_REPLACE = Symbol.replace;
|
||
|
|
const SYM_SEARCH = Symbol.search;
|
||
|
|
const SYM_SPECIES = Symbol.species;
|
||
|
|
const SYM_SPLIT = Symbol.split;
|
||
|
|
const SYM_TO_PRIMITIVE = Symbol.toPrimitive;
|
||
|
|
const SYM_TO_STRING_TAG = Symbol.toStringTag;
|
||
|
|
const SYM_UNSCOPABLES = Symbol.unscopables;
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/constants.ts
|
||
|
|
const TEMPORAL_TYPE_NAME = {
|
||
|
|
[0]: "Instant",
|
||
|
|
[1]: "Duration",
|
||
|
|
[2]: "PlainDate",
|
||
|
|
[3]: "PlainDateTime",
|
||
|
|
[4]: "PlainMonthDay",
|
||
|
|
[5]: "PlainTime",
|
||
|
|
[6]: "PlainYearMonth",
|
||
|
|
[7]: "ZonedDateTime"
|
||
|
|
};
|
||
|
|
const SYMBOL_REF = {
|
||
|
|
[0]: SYM_ASYNC_ITERATOR,
|
||
|
|
[1]: SYM_HAS_INSTANCE,
|
||
|
|
[2]: SYM_IS_CONCAT_SPREADABLE,
|
||
|
|
[3]: SYM_ITERATOR,
|
||
|
|
[4]: SYM_MATCH,
|
||
|
|
[5]: SYM_MATCH_ALL,
|
||
|
|
[6]: SYM_REPLACE,
|
||
|
|
[7]: SYM_SEARCH,
|
||
|
|
[8]: SYM_SPECIES,
|
||
|
|
[9]: SYM_SPLIT,
|
||
|
|
[10]: SYM_TO_PRIMITIVE,
|
||
|
|
[11]: SYM_TO_STRING_TAG,
|
||
|
|
[12]: SYM_UNSCOPABLES
|
||
|
|
};
|
||
|
|
function createSymbolStringTable() {
|
||
|
|
const result = {};
|
||
|
|
for (let i = 0; i <= 12; i++) result[i] = SYMBOL_REF[i].description;
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
const SYMBOL_STRING = /* @__PURE__ */ createSymbolStringTable();
|
||
|
|
function createInverseSymbolTable() {
|
||
|
|
const result = {};
|
||
|
|
for (let i = 0; i <= 12; i++) result[SYMBOL_REF[i]] = i;
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
const INV_SYMBOL_REF = /* @__PURE__ */ createInverseSymbolTable();
|
||
|
|
const CONSTANT_STRING = {
|
||
|
|
[2]: "!0",
|
||
|
|
[3]: "!1",
|
||
|
|
[1]: "void 0",
|
||
|
|
[0]: "null",
|
||
|
|
[4]: "-0",
|
||
|
|
[5]: "1/0",
|
||
|
|
[6]: "-1/0",
|
||
|
|
[7]: "0/0"
|
||
|
|
};
|
||
|
|
const CONSTANT_VAL = {
|
||
|
|
[2]: true,
|
||
|
|
[3]: false,
|
||
|
|
[1]: void 0,
|
||
|
|
[0]: null,
|
||
|
|
[4]: -0,
|
||
|
|
[5]: Infinity,
|
||
|
|
[6]: -Infinity,
|
||
|
|
[7]: NaN
|
||
|
|
};
|
||
|
|
const ERROR_CONSTRUCTOR = {
|
||
|
|
[0]: Error,
|
||
|
|
[1]: EvalError,
|
||
|
|
[2]: RangeError,
|
||
|
|
[3]: ReferenceError,
|
||
|
|
[4]: SyntaxError,
|
||
|
|
[5]: TypeError,
|
||
|
|
[6]: URIError
|
||
|
|
};
|
||
|
|
function createErrorConstructorStringTable() {
|
||
|
|
const result = {};
|
||
|
|
for (let i = 0; i <= 6; i++) result[i] = ERROR_CONSTRUCTOR[i].name;
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
const ERROR_CONSTRUCTOR_STRING = /* @__PURE__ */ createErrorConstructorStringTable();
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/string.ts
|
||
|
|
const MIN_JSON_STRINGIFY_LENGTH = 64;
|
||
|
|
const NEEDS_ESCAPE = /["\\\n\r\b\t\f<\u2028\u2029]/;
|
||
|
|
const JSON_ESCAPE_DIFFERENCES = /[\x00-\x07\x0b\x0e-\x1f\ud800-\udfff]/;
|
||
|
|
const LESS_THAN = /</g;
|
||
|
|
const LINE_SEPARATOR = /\u2028/g;
|
||
|
|
const PARAGRAPH_SEPARATOR = /\u2029/g;
|
||
|
|
function escapeCharCode(code) {
|
||
|
|
switch (code) {
|
||
|
|
case 34: return "\\\"";
|
||
|
|
case 92: return "\\\\";
|
||
|
|
case 10: return "\\n";
|
||
|
|
case 13: return "\\r";
|
||
|
|
case 8: return "\\b";
|
||
|
|
case 9: return "\\t";
|
||
|
|
case 12: return "\\f";
|
||
|
|
case 60: return "\\x3C";
|
||
|
|
case 8232: return "\\u2028";
|
||
|
|
case 8233: return "\\u2029";
|
||
|
|
default: return;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
function serializeString(input) {
|
||
|
|
const str = "" + input;
|
||
|
|
if (!NEEDS_ESCAPE.test(str)) return str;
|
||
|
|
if (str.length >= MIN_JSON_STRINGIFY_LENGTH && !JSON_ESCAPE_DIFFERENCES.test(str)) {
|
||
|
|
let result = JSON.stringify(str).slice(1, -1);
|
||
|
|
if (result.includes("<")) result = result.replace(LESS_THAN, "\\x3C");
|
||
|
|
if (result.includes("\u2028")) result = result.replace(LINE_SEPARATOR, "\\u2028");
|
||
|
|
if (result.includes("\u2029")) result = result.replace(PARAGRAPH_SEPARATOR, "\\u2029");
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
let result = "";
|
||
|
|
let lastPos = 0;
|
||
|
|
let replacement;
|
||
|
|
for (let i = 0, len = str.length; i < len; i++) {
|
||
|
|
replacement = escapeCharCode(str.charCodeAt(i));
|
||
|
|
if (replacement) {
|
||
|
|
result += str.slice(lastPos, i) + replacement;
|
||
|
|
lastPos = i + 1;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return result + str.slice(lastPos);
|
||
|
|
}
|
||
|
|
const JSON_COMPATIBLE = /^(?:[^"\\\x00-\x1f]|\\["\\nrbtf])*$/;
|
||
|
|
const ESCAPE_SEQUENCE = /(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g;
|
||
|
|
function deserializeString(str) {
|
||
|
|
if (typeof str !== "string") return str.replace(ESCAPE_SEQUENCE, deserializeString);
|
||
|
|
let index = str.indexOf("\\");
|
||
|
|
if (index === -1) return str;
|
||
|
|
if (JSON_COMPATIBLE.test(str)) return JSON.parse("\"" + str + "\"");
|
||
|
|
let result = "";
|
||
|
|
let lastPos = 0;
|
||
|
|
const last = str.length - 1;
|
||
|
|
while (index !== -1 && index < last) {
|
||
|
|
let replacement;
|
||
|
|
let length = 2;
|
||
|
|
switch (str.charCodeAt(index + 1)) {
|
||
|
|
case 92:
|
||
|
|
replacement = "\\";
|
||
|
|
break;
|
||
|
|
case 34:
|
||
|
|
replacement = "\"";
|
||
|
|
break;
|
||
|
|
case 110:
|
||
|
|
replacement = "\n";
|
||
|
|
break;
|
||
|
|
case 114:
|
||
|
|
replacement = "\r";
|
||
|
|
break;
|
||
|
|
case 98:
|
||
|
|
replacement = "\b";
|
||
|
|
break;
|
||
|
|
case 116:
|
||
|
|
replacement = " ";
|
||
|
|
break;
|
||
|
|
case 102:
|
||
|
|
replacement = "\f";
|
||
|
|
break;
|
||
|
|
case 120:
|
||
|
|
if (str.startsWith("3C", index + 2)) {
|
||
|
|
replacement = "<";
|
||
|
|
length = 4;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 117: if (str.startsWith("2028", index + 2)) {
|
||
|
|
replacement = "\u2028";
|
||
|
|
length = 6;
|
||
|
|
} else if (str.startsWith("2029", index + 2)) {
|
||
|
|
replacement = "\u2029";
|
||
|
|
length = 6;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (replacement) {
|
||
|
|
result += str.slice(lastPos, index) + replacement;
|
||
|
|
lastPos = index + length;
|
||
|
|
index = str.indexOf("\\", lastPos);
|
||
|
|
} else index = str.indexOf("\\", index + 1);
|
||
|
|
}
|
||
|
|
return result + str.slice(lastPos);
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/errors.ts
|
||
|
|
const STEP_ERROR_CODES = {
|
||
|
|
parsing: 1,
|
||
|
|
serialization: 2,
|
||
|
|
deserialization: 3
|
||
|
|
};
|
||
|
|
function getErrorMessageProd(type) {
|
||
|
|
return `Seroval Error (step: ${STEP_ERROR_CODES[type]})`;
|
||
|
|
}
|
||
|
|
var SerovalError = class extends Error {
|
||
|
|
constructor(type, cause) {
|
||
|
|
super(getErrorMessageProd(type));
|
||
|
|
this.cause = cause;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalParserError = class extends SerovalError {
|
||
|
|
constructor(cause) {
|
||
|
|
super("parsing", cause);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalSerializationError = class extends SerovalError {
|
||
|
|
constructor(cause) {
|
||
|
|
super("serialization", cause);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalDeserializationError = class extends SerovalError {
|
||
|
|
constructor(cause) {
|
||
|
|
super("deserialization", cause);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
function getSpecificErrorMessage(code) {
|
||
|
|
return `Seroval Error (specific: ${code})`;
|
||
|
|
}
|
||
|
|
var SerovalUnsupportedTypeError = class extends Error {
|
||
|
|
constructor(value) {
|
||
|
|
super(getSpecificErrorMessage(1));
|
||
|
|
this.value = value;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalUnsupportedNodeError = class extends Error {
|
||
|
|
constructor(node) {
|
||
|
|
super(getSpecificErrorMessage(2));
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalMissingPluginError = class extends Error {
|
||
|
|
constructor(tag) {
|
||
|
|
super(getSpecificErrorMessage(3));
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalPluginValidationError = class extends Error {
|
||
|
|
constructor(tag, field) {
|
||
|
|
super(getSpecificErrorMessage(13));
|
||
|
|
this.tag = tag;
|
||
|
|
this.field = field;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalMissingInstanceError = class extends Error {
|
||
|
|
constructor(tag) {
|
||
|
|
super(getSpecificErrorMessage(4));
|
||
|
|
}
|
||
|
|
};
|
||
|
|
/**
|
||
|
|
* @deprecated Not thrown by seroval. A missing `createReference` key throws
|
||
|
|
* {@link SerovalMissingReferenceForIdError} instead.
|
||
|
|
*/
|
||
|
|
var SerovalMissingReferenceError = class extends Error {
|
||
|
|
constructor(value) {
|
||
|
|
super(getSpecificErrorMessage(5));
|
||
|
|
this.value = value;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalMissingReferenceForIdError = class extends Error {
|
||
|
|
constructor(id) {
|
||
|
|
super(getSpecificErrorMessage(6));
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalUnknownTypedArrayError = class extends Error {
|
||
|
|
constructor(name) {
|
||
|
|
super(getSpecificErrorMessage(7));
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalMalformedNodeError = class extends Error {
|
||
|
|
constructor(node) {
|
||
|
|
super(getSpecificErrorMessage(8));
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalConflictedNodeIdError = class extends Error {
|
||
|
|
constructor(node) {
|
||
|
|
super(getSpecificErrorMessage(9));
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalDepthLimitError = class extends Error {
|
||
|
|
constructor(limit) {
|
||
|
|
super(getSpecificErrorMessage(10));
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalAbortedError = class extends Error {
|
||
|
|
constructor() {
|
||
|
|
super(getSpecificErrorMessage(11));
|
||
|
|
}
|
||
|
|
};
|
||
|
|
var SerovalLiveStreamError = class extends Error {
|
||
|
|
constructor(reason) {
|
||
|
|
super(getSpecificErrorMessage(12));
|
||
|
|
this.reason = reason;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/keys.ts
|
||
|
|
const REFERENCES_KEY = "__SEROVAL_REFS__";
|
||
|
|
const GLOBAL_CONTEXT_R = `self.\$R`;
|
||
|
|
function getCrossReferenceHeader(id) {
|
||
|
|
if (id == null) return `${GLOBAL_CONTEXT_R}=${GLOBAL_CONTEXT_R}||[]`;
|
||
|
|
return `(${GLOBAL_CONTEXT_R}=${GLOBAL_CONTEXT_R}||{})["${serializeString(id)}"]=[]`;
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/reference.ts
|
||
|
|
const REFERENCE = /* @__PURE__ */ new Map();
|
||
|
|
const INV_REFERENCE = /* @__PURE__ */ new Map();
|
||
|
|
let installed = false;
|
||
|
|
function getGlobalObject() {
|
||
|
|
if (typeof globalThis !== "undefined") return globalThis;
|
||
|
|
if (typeof window !== "undefined") return window;
|
||
|
|
if (typeof self !== "undefined") return self;
|
||
|
|
if (typeof global !== "undefined") return global;
|
||
|
|
}
|
||
|
|
function installReferenceStore() {
|
||
|
|
if (!installed) {
|
||
|
|
installed = true;
|
||
|
|
const globalObject = getGlobalObject();
|
||
|
|
if (globalObject) Object.defineProperty(globalObject, REFERENCES_KEY, {
|
||
|
|
value: INV_REFERENCE,
|
||
|
|
configurable: true,
|
||
|
|
writable: false,
|
||
|
|
enumerable: false
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
function createReference(id, value) {
|
||
|
|
installReferenceStore();
|
||
|
|
REFERENCE.set(value, id);
|
||
|
|
INV_REFERENCE.set(id, value);
|
||
|
|
return value;
|
||
|
|
}
|
||
|
|
function hasReference(id) {
|
||
|
|
return INV_REFERENCE.has(id);
|
||
|
|
}
|
||
|
|
function getReferenceID(value) {
|
||
|
|
return REFERENCE.get(value);
|
||
|
|
}
|
||
|
|
function getReference(id) {
|
||
|
|
if (hasReference(id)) return INV_REFERENCE.get(id);
|
||
|
|
throw new SerovalMissingReferenceForIdError(id);
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/sequence.ts
|
||
|
|
/**
|
||
|
|
* An internal class rather than a tagged POJO: identity is checked with
|
||
|
|
* `instanceof`, which untrusted input cannot forge. The class is exported
|
||
|
|
* because bundlers cannot drop an unexported top-level class.
|
||
|
|
* The eval-based `deserialize` path still rebuilds a `{__SEROVAL_SEQUENCE__…}`
|
||
|
|
* POJO from embedded source - it has no access to this class - so a value read
|
||
|
|
* back through `deserialize` is not an instance and, by design, is not treated
|
||
|
|
* as a genuine Sequence on re-serialization.
|
||
|
|
*/
|
||
|
|
var Sequence = class {
|
||
|
|
constructor(values, throwAt, doneAt) {
|
||
|
|
this.v = values;
|
||
|
|
this.t = throwAt;
|
||
|
|
this.d = doneAt;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
function isSequence(value) {
|
||
|
|
return value instanceof Sequence;
|
||
|
|
}
|
||
|
|
function createSequence(values, throwAt, doneAt) {
|
||
|
|
return new Sequence(values, throwAt, doneAt);
|
||
|
|
}
|
||
|
|
function createSequenceFromIterable(source) {
|
||
|
|
const values = [];
|
||
|
|
let throwsAt = -1;
|
||
|
|
let doneAt = -1;
|
||
|
|
const iterator = source[SYM_ITERATOR]();
|
||
|
|
for (;;) try {
|
||
|
|
const value = iterator.next();
|
||
|
|
values.push(value.value);
|
||
|
|
if (value.done) {
|
||
|
|
doneAt = values.length - 1;
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
} catch (error) {
|
||
|
|
throwsAt = values.length;
|
||
|
|
doneAt = throwsAt;
|
||
|
|
values.push(error);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
return createSequence(values, throwsAt, doneAt);
|
||
|
|
}
|
||
|
|
const createIterator = /* @__PURE__ */ ITERATOR_CONSTRUCTOR(SYM_ITERATOR);
|
||
|
|
function sequenceToIterator(sequence) {
|
||
|
|
return createIterator(sequence);
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/live-stream.ts
|
||
|
|
const BRAND = /* @__PURE__ */ Symbol("LiveStream");
|
||
|
|
function isLiveStream(value) {
|
||
|
|
return value != null && value[BRAND] === true;
|
||
|
|
}
|
||
|
|
/**
|
||
|
|
* A single-consumer stream for incremental serialization. Unlike
|
||
|
|
* `createStream`, it keeps no history: at most one event is held, and the
|
||
|
|
* producer operation that sent it settles only when the consumer accepts it.
|
||
|
|
*
|
||
|
|
* An internal class rather than a tagged POJO: identity is checked with
|
||
|
|
* `isLiveStream`, which untrusted input cannot forge. The class is exported
|
||
|
|
* because bundlers cannot drop an unexported top-level class.
|
||
|
|
*/
|
||
|
|
var LiveStream = class {
|
||
|
|
constructor(options) {
|
||
|
|
this[BRAND] = true;
|
||
|
|
this.consumed = false;
|
||
|
|
this.closed = false;
|
||
|
|
this.cancelled = false;
|
||
|
|
this.options = options;
|
||
|
|
}
|
||
|
|
deliver(reader, record) {
|
||
|
|
record.delivered = true;
|
||
|
|
reader.resolve({
|
||
|
|
event: record.event,
|
||
|
|
accept: () => {
|
||
|
|
if (this.pending === record && record.delivered) {
|
||
|
|
const terminal = record.event.type !== "next";
|
||
|
|
record.event = void 0;
|
||
|
|
this.pending = void 0;
|
||
|
|
const resolve = record.resolve;
|
||
|
|
record.resolve = void 0;
|
||
|
|
record.reject = void 0;
|
||
|
|
if (terminal) {
|
||
|
|
this.closed = true;
|
||
|
|
this.options = void 0;
|
||
|
|
const waiter = this.waiting;
|
||
|
|
this.waiting = void 0;
|
||
|
|
waiter?.reject(new SerovalLiveStreamError("closed"));
|
||
|
|
}
|
||
|
|
resolve?.();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
/** @internal */
|
||
|
|
push(event) {
|
||
|
|
if (this.cancelled) return Promise.reject(this.cancelReason);
|
||
|
|
if (this.closed) return Promise.reject(new SerovalLiveStreamError("closed"));
|
||
|
|
if (this.pending) return Promise.reject(new SerovalLiveStreamError("pending"));
|
||
|
|
return new Promise((resolve, reject) => {
|
||
|
|
const record = {
|
||
|
|
event,
|
||
|
|
delivered: false,
|
||
|
|
resolve,
|
||
|
|
reject
|
||
|
|
};
|
||
|
|
this.pending = record;
|
||
|
|
if (this.waiting) {
|
||
|
|
const waiter = this.waiting;
|
||
|
|
this.waiting = void 0;
|
||
|
|
this.deliver(waiter, record);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
cancel(reason) {
|
||
|
|
if (this.cancelled || this.closed) return;
|
||
|
|
this.cancelled = true;
|
||
|
|
this.cancelReason = reason;
|
||
|
|
const record = this.pending;
|
||
|
|
const waiter = this.waiting;
|
||
|
|
this.pending = void 0;
|
||
|
|
this.waiting = void 0;
|
||
|
|
const callbackOwner = this.options;
|
||
|
|
this.options = void 0;
|
||
|
|
if (record) {
|
||
|
|
record.event = void 0;
|
||
|
|
const reject = record.reject;
|
||
|
|
record.resolve = void 0;
|
||
|
|
record.reject = void 0;
|
||
|
|
reject?.(reason);
|
||
|
|
}
|
||
|
|
if (waiter) waiter.reject(reason);
|
||
|
|
callbackOwner?.onCancel?.(reason);
|
||
|
|
}
|
||
|
|
read() {
|
||
|
|
if (this.cancelled) return Promise.reject(this.cancelReason);
|
||
|
|
if (this.closed) return Promise.reject(new SerovalLiveStreamError("closed"));
|
||
|
|
if (this.waiting) return Promise.reject(new SerovalLiveStreamError("reading"));
|
||
|
|
return new Promise((resolve, reject) => {
|
||
|
|
const next = {
|
||
|
|
resolve,
|
||
|
|
reject
|
||
|
|
};
|
||
|
|
if (this.pending && !this.pending.delivered) this.deliver(next, this.pending);
|
||
|
|
else this.waiting = next;
|
||
|
|
});
|
||
|
|
}
|
||
|
|
consume() {
|
||
|
|
if (this.consumed) throw new SerovalLiveStreamError("consumed");
|
||
|
|
this.consumed = true;
|
||
|
|
return {
|
||
|
|
read: () => this.read(),
|
||
|
|
cancel: (reason) => this.cancel(reason)
|
||
|
|
};
|
||
|
|
}
|
||
|
|
/**
|
||
|
|
* Consumes the stream through a replay-style listener, accepting each
|
||
|
|
* event as soon as it has been delivered. Use `consume` or `pump` when
|
||
|
|
* acceptance must wait for processing.
|
||
|
|
*/
|
||
|
|
on(listener) {
|
||
|
|
const wrap = (key) => (value, accept) => {
|
||
|
|
listener[key](value);
|
||
|
|
accept();
|
||
|
|
};
|
||
|
|
return this.pump({
|
||
|
|
next: wrap("next"),
|
||
|
|
throw: wrap("throw"),
|
||
|
|
return: wrap("return")
|
||
|
|
});
|
||
|
|
}
|
||
|
|
/**
|
||
|
|
* Consumes the stream into a sink that controls acceptance. Returns the
|
||
|
|
* cancel function.
|
||
|
|
* @internal
|
||
|
|
*/
|
||
|
|
pump(sink) {
|
||
|
|
const consumer = this.consume();
|
||
|
|
let current = sink;
|
||
|
|
function next() {
|
||
|
|
consumer.read().then((delivery) => {
|
||
|
|
const target = current;
|
||
|
|
if (!target) return;
|
||
|
|
const event = delivery.event;
|
||
|
|
let failure;
|
||
|
|
let failed = false;
|
||
|
|
try {
|
||
|
|
failure = target[event.type](event.type === "throw" ? event.error : event.value, delivery.accept);
|
||
|
|
} catch (error) {
|
||
|
|
failed = true;
|
||
|
|
failure = error;
|
||
|
|
}
|
||
|
|
if (failed || failure !== void 0) {
|
||
|
|
current = void 0;
|
||
|
|
try {
|
||
|
|
consumer.cancel(failure);
|
||
|
|
} finally {
|
||
|
|
target.done?.();
|
||
|
|
}
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if (event.type === "next") {
|
||
|
|
next();
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
current = void 0;
|
||
|
|
target.done?.();
|
||
|
|
}, (reason) => {
|
||
|
|
const target = current;
|
||
|
|
current = void 0;
|
||
|
|
target?.error?.(reason);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
next();
|
||
|
|
return consumer.cancel;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
/**
|
||
|
|
* Creates a live stream and the producer that writes to it.
|
||
|
|
*/
|
||
|
|
function createLiveStream(options) {
|
||
|
|
const stream = new LiveStream(options);
|
||
|
|
return {
|
||
|
|
stream,
|
||
|
|
producer: {
|
||
|
|
write(value) {
|
||
|
|
return stream.push({
|
||
|
|
type: "next",
|
||
|
|
value
|
||
|
|
});
|
||
|
|
},
|
||
|
|
close(value) {
|
||
|
|
return stream.push({
|
||
|
|
type: "return",
|
||
|
|
value
|
||
|
|
});
|
||
|
|
},
|
||
|
|
fail(error) {
|
||
|
|
return stream.push({
|
||
|
|
type: "throw",
|
||
|
|
error
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/stream.ts
|
||
|
|
/**
|
||
|
|
* An internal class rather than a tagged POJO: identity is checked with
|
||
|
|
* `instanceof`, which untrusted input cannot forge. The class is exported
|
||
|
|
* because bundlers cannot drop an unexported top-level class.
|
||
|
|
*
|
||
|
|
* The behavior is intentionally duplicated from `STREAM_CONSTRUCTOR`. That
|
||
|
|
* constructor's source is embedded verbatim into the eval-based `deserialize`
|
||
|
|
* output, which has no access to this class, so the two cannot be shared. A
|
||
|
|
* stream read back through `deserialize` is therefore a plain POJO and, by
|
||
|
|
* design, is not treated as a genuine Stream on re-serialization. Keep the two
|
||
|
|
* implementations in sync.
|
||
|
|
*/
|
||
|
|
var Stream = class {
|
||
|
|
constructor(live) {
|
||
|
|
this.buffer = [];
|
||
|
|
this.listeners = [];
|
||
|
|
this.alive = true;
|
||
|
|
this.success = false;
|
||
|
|
this.count = 0;
|
||
|
|
this.live = live;
|
||
|
|
}
|
||
|
|
flush(value, mode) {
|
||
|
|
this.live > 1 || this.buffer.push(value);
|
||
|
|
for (let x = 0; x < this.count; x++) this.listeners[x]?.[mode](value);
|
||
|
|
}
|
||
|
|
replay(listener) {
|
||
|
|
for (let x = 0, z = this.buffer.length; x < z; x++) {
|
||
|
|
const current = this.buffer[x];
|
||
|
|
if (!this.alive && x === z - 1) listener[this.success ? "return" : "throw"](current);
|
||
|
|
else listener.next(current);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
on(listener) {
|
||
|
|
if (this.live > 1) throw new Error("Stream consumed");
|
||
|
|
let subscribed = this.alive;
|
||
|
|
let temp = 0;
|
||
|
|
if (subscribed) {
|
||
|
|
for (; temp < this.count; temp++) if (!this.listeners[temp]) break;
|
||
|
|
if (temp === this.count) this.count++;
|
||
|
|
this.listeners[temp] = listener;
|
||
|
|
}
|
||
|
|
this.replay(listener);
|
||
|
|
if (this.live) {
|
||
|
|
this.live = 2;
|
||
|
|
this.buffer.length = 0;
|
||
|
|
}
|
||
|
|
return () => {
|
||
|
|
if (this.alive && subscribed) {
|
||
|
|
subscribed = false;
|
||
|
|
this.listeners[temp] = void 0;
|
||
|
|
while (this.count > 0 && !this.listeners[this.count - 1]) this.count--;
|
||
|
|
this.listeners.length = this.count;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|
||
|
|
/**
|
||
|
|
* Returns the events of a stream that has ended, without subscribing, so a
|
||
|
|
* live receiver is not consumed. The last value is the `return` or `throw`
|
||
|
|
* value. Returns `undefined` while the stream is open, or when a live
|
||
|
|
* receiver was already consumed and has no events left.
|
||
|
|
* @internal
|
||
|
|
*/
|
||
|
|
endedEvents() {
|
||
|
|
if (this.alive || this.live > 1) return void 0;
|
||
|
|
return {
|
||
|
|
values: this.buffer.slice(),
|
||
|
|
success: this.success
|
||
|
|
};
|
||
|
|
}
|
||
|
|
next(value) {
|
||
|
|
if (this.alive) this.flush(value, "next");
|
||
|
|
}
|
||
|
|
throw(value) {
|
||
|
|
if (this.alive) {
|
||
|
|
this.flush(value, "throw");
|
||
|
|
this.alive = false;
|
||
|
|
this.success = false;
|
||
|
|
this.listeners.length = 0;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return(value) {
|
||
|
|
if (this.alive) {
|
||
|
|
this.flush(value, "return");
|
||
|
|
this.alive = false;
|
||
|
|
this.success = true;
|
||
|
|
this.listeners.length = 0;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
};
|
||
|
|
function isStream(value) {
|
||
|
|
return value instanceof Stream || isLiveStream(value);
|
||
|
|
}
|
||
|
|
function createStream() {
|
||
|
|
return new Stream();
|
||
|
|
}
|
||
|
|
const createAsyncIterable = /* @__PURE__ */ ASYNC_ITERATOR_CONSTRUCTOR(SYM_ASYNC_ITERATOR, PROMISE_CONSTRUCTOR);
|
||
|
|
function streamToAsyncIterable(stream) {
|
||
|
|
return createAsyncIterable(stream);
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/plugin.ts
|
||
|
|
let SerovalMode = /* @__PURE__ */ function(SerovalMode) {
|
||
|
|
SerovalMode[SerovalMode["Vanilla"] = 1] = "Vanilla";
|
||
|
|
SerovalMode[SerovalMode["Cross"] = 2] = "Cross";
|
||
|
|
return SerovalMode;
|
||
|
|
}({});
|
||
|
|
function createPlugin(plugin) {
|
||
|
|
return plugin;
|
||
|
|
}
|
||
|
|
function dedupePlugins(deduped, plugins) {
|
||
|
|
for (let i = 0, len = plugins.length; i < len; i++) {
|
||
|
|
const current = plugins[i];
|
||
|
|
if (!deduped.has(current)) {
|
||
|
|
deduped.add(current);
|
||
|
|
if (current.extends) dedupePlugins(deduped, current.extends);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
const RESOLVED_PLUGINS = /* @__PURE__ */ new WeakMap();
|
||
|
|
function matchResolved(resolved, plugins, added) {
|
||
|
|
for (let i = 0, len = plugins.length; i < len; i++) {
|
||
|
|
const current = plugins[i];
|
||
|
|
if (current === resolved[added]) {
|
||
|
|
added++;
|
||
|
|
if (current.extends) {
|
||
|
|
added = matchResolved(resolved, current.extends, added);
|
||
|
|
if (added === -1) return -1;
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
const index = resolved.indexOf(current);
|
||
|
|
if (index === -1 || index >= added) return -1;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return added;
|
||
|
|
}
|
||
|
|
function resolvePlugins(plugins) {
|
||
|
|
if (plugins) {
|
||
|
|
const cached = RESOLVED_PLUGINS.get(plugins);
|
||
|
|
if (cached && matchResolved(cached, plugins, 0) === cached.length) return cached;
|
||
|
|
const deduped = /* @__PURE__ */ new Set();
|
||
|
|
dedupePlugins(deduped, plugins);
|
||
|
|
const resolved = [...deduped];
|
||
|
|
RESOLVED_PLUGINS.set(plugins, resolved);
|
||
|
|
return resolved;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
/**
|
||
|
|
* Returns the plugins that are tested for plain objects. It is the same array
|
||
|
|
* when no plugin sets `skipPlainObjects`.
|
||
|
|
*/
|
||
|
|
function getPlainObjectPlugins(plugins) {
|
||
|
|
if (plugins) {
|
||
|
|
for (let i = 0, len = plugins.length; i < len; i++) if (plugins[i].skipPlainObjects) {
|
||
|
|
const result = plugins.filter((plugin) => !plugin.skipPlainObjects);
|
||
|
|
return result.length ? result : void 0;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return plugins;
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
//#region src/core/opaque-reference.ts
|
||
|
|
/**
|
||
|
|
* An opaque reference allows hiding values from the serializer.
|
||
|
|
*/
|
||
|
|
var OpaqueReference = class {
|
||
|
|
constructor(value, replacement) {
|
||
|
|
this.value = value;
|
||
|
|
this.replacement = replacement;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
//#endregion
|
||
|
|
Object.defineProperty(exports, "ARRAY_BUFFER_CONSTRUCTOR", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return ARRAY_BUFFER_CONSTRUCTOR;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "CONSTANT_STRING", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return CONSTANT_STRING;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "CONSTANT_VAL", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return CONSTANT_VAL;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "ERROR_CONSTRUCTOR", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return ERROR_CONSTRUCTOR;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "ERROR_CONSTRUCTOR_STRING", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return ERROR_CONSTRUCTOR_STRING;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "Feature", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return Feature;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "INV_SYMBOL_REF", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return INV_SYMBOL_REF;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "LiveStream", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return LiveStream;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "OpaqueReference", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return OpaqueReference;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "PROMISE_CONSTRUCTOR", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return PROMISE_CONSTRUCTOR;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "REFERENCES_KEY", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return REFERENCES_KEY;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SERIALIZED_ARRAY_BUFFER_CONSTRUCTOR", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SERIALIZED_ARRAY_BUFFER_CONSTRUCTOR;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SERIALIZED_ASYNC_ITERATOR_CONSTRUCTOR", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SERIALIZED_ASYNC_ITERATOR_CONSTRUCTOR;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SERIALIZED_ITERATOR_CONSTRUCTOR", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SERIALIZED_ITERATOR_CONSTRUCTOR;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SERIALIZED_PROMISE_CONSTRUCTOR", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SERIALIZED_PROMISE_CONSTRUCTOR;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SERIALIZED_PROMISE_FAILURE", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SERIALIZED_PROMISE_FAILURE;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SERIALIZED_PROMISE_SUCCESS", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SERIALIZED_PROMISE_SUCCESS;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SERIALIZED_STREAM_CONSTRUCTOR", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SERIALIZED_STREAM_CONSTRUCTOR;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SYMBOL_REF", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SYMBOL_REF;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SYMBOL_STRING", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SYMBOL_STRING;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SYM_ASYNC_ITERATOR", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SYM_ASYNC_ITERATOR;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SYM_IS_CONCAT_SPREADABLE", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SYM_IS_CONCAT_SPREADABLE;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SYM_ITERATOR", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SYM_ITERATOR;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SYM_TO_STRING_TAG", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SYM_TO_STRING_TAG;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "Sequence", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return Sequence;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalAbortedError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalAbortedError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalConflictedNodeIdError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalConflictedNodeIdError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalDepthLimitError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalDepthLimitError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalDeserializationError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalDeserializationError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalLiveStreamError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalLiveStreamError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalMalformedNodeError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalMalformedNodeError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalMissingInstanceError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalMissingInstanceError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalMissingPluginError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalMissingPluginError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalMissingReferenceError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalMissingReferenceError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalMissingReferenceForIdError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalMissingReferenceForIdError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalMode", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalMode;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalParserError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalParserError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalPluginValidationError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalPluginValidationError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalSerializationError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalSerializationError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalUnknownTypedArrayError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalUnknownTypedArrayError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalUnsupportedNodeError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalUnsupportedNodeError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "SerovalUnsupportedTypeError", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return SerovalUnsupportedTypeError;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "Stream", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return Stream;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "TEMPORAL_TYPE_NAME", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return TEMPORAL_TYPE_NAME;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "createLiveStream", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return createLiveStream;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "createPlugin", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return createPlugin;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "createReference", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return createReference;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "createSequence", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return createSequence;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "createSequenceFromIterable", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return createSequenceFromIterable;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "createStream", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return createStream;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "deserializeString", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return deserializeString;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "getCrossReferenceHeader", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return getCrossReferenceHeader;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "getPlainObjectPlugins", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return getPlainObjectPlugins;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "getReference", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return getReference;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "getReferenceID", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return getReferenceID;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "isLiveStream", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return isLiveStream;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "isSequence", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return isSequence;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "isStream", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return isStream;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "resolvePlugins", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return resolvePlugins;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "sequenceToIterator", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return sequenceToIterator;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "serializeString", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return serializeString;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(exports, "streamToAsyncIterable", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return streamToAsyncIterable;
|
||
|
|
}
|
||
|
|
});
|