typeson-registry 3.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +52 -11
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.js +1002 -803
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/presets/array-nonindex-keys.umd.js.map +1 -1
- package/dist/presets/builtin.umd.js +1 -1
- package/dist/presets/builtin.umd.js.map +1 -1
- package/dist/presets/postmessage.umd.js +1 -1
- package/dist/presets/postmessage.umd.js.map +1 -1
- package/dist/presets/socketio.umd.js +1 -1
- package/dist/presets/socketio.umd.js.map +1 -1
- package/dist/presets/sparse-undefined.umd.js.map +1 -1
- package/dist/presets/special-numbers.umd.js.map +1 -1
- package/dist/presets/structured-cloning-throwing.umd.js +1 -1
- package/dist/presets/structured-cloning-throwing.umd.js.map +1 -1
- package/dist/presets/structured-cloning.umd.js +1 -1
- package/dist/presets/structured-cloning.umd.js.map +1 -1
- package/dist/presets/undef.umd.js +1 -1
- package/dist/presets/undef.umd.js.map +1 -1
- package/dist/presets/universal.umd.js +1 -1
- package/dist/presets/universal.umd.js.map +1 -1
- package/dist/types/arraybuffer.umd.js +1 -1
- package/dist/types/arraybuffer.umd.js.map +1 -1
- package/dist/types/bigint-object.umd.js +1 -1
- package/dist/types/bigint-object.umd.js.map +1 -1
- package/dist/types/bigint.umd.js.map +1 -1
- package/dist/types/blob.umd.js +1 -1
- package/dist/types/blob.umd.js.map +1 -1
- package/dist/types/cloneable.umd.js.map +1 -1
- package/dist/types/cryptokey.umd.js +1 -1
- package/dist/types/cryptokey.umd.js.map +1 -1
- package/dist/types/dataview.umd.js +1 -1
- package/dist/types/dataview.umd.js.map +1 -1
- package/dist/types/date.umd.js +1 -1
- package/dist/types/date.umd.js.map +1 -1
- package/dist/types/error.umd.js +1 -1
- package/dist/types/error.umd.js.map +1 -1
- package/dist/types/errors.umd.js +1 -1
- package/dist/types/errors.umd.js.map +1 -1
- package/dist/types/file.umd.js +1 -1
- package/dist/types/file.umd.js.map +1 -1
- package/dist/types/filelist.umd.js +1 -1
- package/dist/types/filelist.umd.js.map +1 -1
- package/dist/types/imagebitmap.umd.js +1 -1
- package/dist/types/imagebitmap.umd.js.map +1 -1
- package/dist/types/imagedata.umd.js +1 -1
- package/dist/types/imagedata.umd.js.map +1 -1
- package/dist/types/infinity.umd.js.map +1 -1
- package/dist/types/intl-types.umd.js +1 -1
- package/dist/types/intl-types.umd.js.map +1 -1
- package/dist/types/map.umd.js +1 -1
- package/dist/types/map.umd.js.map +1 -1
- package/dist/types/nan.umd.js.map +1 -1
- package/dist/types/negative-infinity.umd.js.map +1 -1
- package/dist/types/nonbuiltin-ignore.umd.js +1 -1
- package/dist/types/nonbuiltin-ignore.umd.js.map +1 -1
- package/dist/types/primitive-objects.umd.js +1 -1
- package/dist/types/primitive-objects.umd.js.map +1 -1
- package/dist/types/regexp.umd.js +1 -1
- package/dist/types/regexp.umd.js.map +1 -1
- package/dist/types/resurrectable.umd.js.map +1 -1
- package/dist/types/set.umd.js +1 -1
- package/dist/types/set.umd.js.map +1 -1
- package/dist/types/typed-arrays-socketio.umd.js +1 -1
- package/dist/types/typed-arrays-socketio.umd.js.map +1 -1
- package/dist/types/typed-arrays.umd.js +1 -1
- package/dist/types/typed-arrays.umd.js.map +1 -1
- package/dist/types/undef.umd.js +1 -1
- package/dist/types/undef.umd.js.map +1 -1
- package/dist/types/user-object.umd.js +1 -1
- package/dist/types/user-object.umd.js.map +1 -1
- package/package.json +34 -36
- package/polyfills/createObjectURL.umd.js +1 -1
- package/polyfills/createObjectURL.umd.js.map +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -6,17 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
function ownKeys$1(object, enumerableOnly) {
|
|
8
8
|
var keys = Object.keys(object);
|
|
9
|
-
|
|
10
9
|
if (Object.getOwnPropertySymbols) {
|
|
11
10
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
12
11
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
13
12
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
14
13
|
})), keys.push.apply(keys, symbols);
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
return keys;
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
function _objectSpread2$1(target) {
|
|
21
18
|
for (var i = 1; i < arguments.length; i++) {
|
|
22
19
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -26,10 +23,309 @@
|
|
|
26
23
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
27
24
|
});
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
return target;
|
|
31
27
|
}
|
|
32
|
-
|
|
28
|
+
function _regeneratorRuntime() {
|
|
29
|
+
_regeneratorRuntime = function () {
|
|
30
|
+
return exports;
|
|
31
|
+
};
|
|
32
|
+
var exports = {},
|
|
33
|
+
Op = Object.prototype,
|
|
34
|
+
hasOwn = Op.hasOwnProperty,
|
|
35
|
+
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
|
36
|
+
obj[key] = desc.value;
|
|
37
|
+
},
|
|
38
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
39
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
40
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
41
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
42
|
+
function define(obj, key, value) {
|
|
43
|
+
return Object.defineProperty(obj, key, {
|
|
44
|
+
value: value,
|
|
45
|
+
enumerable: !0,
|
|
46
|
+
configurable: !0,
|
|
47
|
+
writable: !0
|
|
48
|
+
}), obj[key];
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
define({}, "");
|
|
52
|
+
} catch (err) {
|
|
53
|
+
define = function (obj, key, value) {
|
|
54
|
+
return obj[key] = value;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
58
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
59
|
+
generator = Object.create(protoGenerator.prototype),
|
|
60
|
+
context = new Context(tryLocsList || []);
|
|
61
|
+
return defineProperty(generator, "_invoke", {
|
|
62
|
+
value: makeInvokeMethod(innerFn, self, context)
|
|
63
|
+
}), generator;
|
|
64
|
+
}
|
|
65
|
+
function tryCatch(fn, obj, arg) {
|
|
66
|
+
try {
|
|
67
|
+
return {
|
|
68
|
+
type: "normal",
|
|
69
|
+
arg: fn.call(obj, arg)
|
|
70
|
+
};
|
|
71
|
+
} catch (err) {
|
|
72
|
+
return {
|
|
73
|
+
type: "throw",
|
|
74
|
+
arg: err
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.wrap = wrap;
|
|
79
|
+
var ContinueSentinel = {};
|
|
80
|
+
function Generator() {}
|
|
81
|
+
function GeneratorFunction() {}
|
|
82
|
+
function GeneratorFunctionPrototype() {}
|
|
83
|
+
var IteratorPrototype = {};
|
|
84
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
85
|
+
return this;
|
|
86
|
+
});
|
|
87
|
+
var getProto = Object.getPrototypeOf,
|
|
88
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
89
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
90
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
91
|
+
function defineIteratorMethods(prototype) {
|
|
92
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
93
|
+
define(prototype, method, function (arg) {
|
|
94
|
+
return this._invoke(method, arg);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
99
|
+
function invoke(method, arg, resolve, reject) {
|
|
100
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
101
|
+
if ("throw" !== record.type) {
|
|
102
|
+
var result = record.arg,
|
|
103
|
+
value = result.value;
|
|
104
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
105
|
+
invoke("next", value, resolve, reject);
|
|
106
|
+
}, function (err) {
|
|
107
|
+
invoke("throw", err, resolve, reject);
|
|
108
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
109
|
+
result.value = unwrapped, resolve(result);
|
|
110
|
+
}, function (error) {
|
|
111
|
+
return invoke("throw", error, resolve, reject);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
reject(record.arg);
|
|
115
|
+
}
|
|
116
|
+
var previousPromise;
|
|
117
|
+
defineProperty(this, "_invoke", {
|
|
118
|
+
value: function (method, arg) {
|
|
119
|
+
function callInvokeWithMethodAndArg() {
|
|
120
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
121
|
+
invoke(method, arg, resolve, reject);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
129
|
+
var state = "suspendedStart";
|
|
130
|
+
return function (method, arg) {
|
|
131
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
132
|
+
if ("completed" === state) {
|
|
133
|
+
if ("throw" === method) throw arg;
|
|
134
|
+
return doneResult();
|
|
135
|
+
}
|
|
136
|
+
for (context.method = method, context.arg = arg;;) {
|
|
137
|
+
var delegate = context.delegate;
|
|
138
|
+
if (delegate) {
|
|
139
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
140
|
+
if (delegateResult) {
|
|
141
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
142
|
+
return delegateResult;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
146
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
147
|
+
context.dispatchException(context.arg);
|
|
148
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
149
|
+
state = "executing";
|
|
150
|
+
var record = tryCatch(innerFn, self, context);
|
|
151
|
+
if ("normal" === record.type) {
|
|
152
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
153
|
+
return {
|
|
154
|
+
value: record.arg,
|
|
155
|
+
done: context.done
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
163
|
+
var methodName = context.method,
|
|
164
|
+
method = delegate.iterator[methodName];
|
|
165
|
+
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
166
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
167
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
168
|
+
var info = record.arg;
|
|
169
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
170
|
+
}
|
|
171
|
+
function pushTryEntry(locs) {
|
|
172
|
+
var entry = {
|
|
173
|
+
tryLoc: locs[0]
|
|
174
|
+
};
|
|
175
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
176
|
+
}
|
|
177
|
+
function resetTryEntry(entry) {
|
|
178
|
+
var record = entry.completion || {};
|
|
179
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
180
|
+
}
|
|
181
|
+
function Context(tryLocsList) {
|
|
182
|
+
this.tryEntries = [{
|
|
183
|
+
tryLoc: "root"
|
|
184
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
185
|
+
}
|
|
186
|
+
function values(iterable) {
|
|
187
|
+
if (iterable) {
|
|
188
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
189
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
190
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
191
|
+
if (!isNaN(iterable.length)) {
|
|
192
|
+
var i = -1,
|
|
193
|
+
next = function next() {
|
|
194
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
195
|
+
return next.value = undefined, next.done = !0, next;
|
|
196
|
+
};
|
|
197
|
+
return next.next = next;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
next: doneResult
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function doneResult() {
|
|
205
|
+
return {
|
|
206
|
+
value: undefined,
|
|
207
|
+
done: !0
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
211
|
+
value: GeneratorFunctionPrototype,
|
|
212
|
+
configurable: !0
|
|
213
|
+
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
214
|
+
value: GeneratorFunction,
|
|
215
|
+
configurable: !0
|
|
216
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
217
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
218
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
219
|
+
}, exports.mark = function (genFun) {
|
|
220
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
221
|
+
}, exports.awrap = function (arg) {
|
|
222
|
+
return {
|
|
223
|
+
__await: arg
|
|
224
|
+
};
|
|
225
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
226
|
+
return this;
|
|
227
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
228
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
229
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
230
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
231
|
+
return result.done ? result.value : iter.next();
|
|
232
|
+
});
|
|
233
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
234
|
+
return this;
|
|
235
|
+
}), define(Gp, "toString", function () {
|
|
236
|
+
return "[object Generator]";
|
|
237
|
+
}), exports.keys = function (val) {
|
|
238
|
+
var object = Object(val),
|
|
239
|
+
keys = [];
|
|
240
|
+
for (var key in object) keys.push(key);
|
|
241
|
+
return keys.reverse(), function next() {
|
|
242
|
+
for (; keys.length;) {
|
|
243
|
+
var key = keys.pop();
|
|
244
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
245
|
+
}
|
|
246
|
+
return next.done = !0, next;
|
|
247
|
+
};
|
|
248
|
+
}, exports.values = values, Context.prototype = {
|
|
249
|
+
constructor: Context,
|
|
250
|
+
reset: function (skipTempReset) {
|
|
251
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
252
|
+
},
|
|
253
|
+
stop: function () {
|
|
254
|
+
this.done = !0;
|
|
255
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
256
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
257
|
+
return this.rval;
|
|
258
|
+
},
|
|
259
|
+
dispatchException: function (exception) {
|
|
260
|
+
if (this.done) throw exception;
|
|
261
|
+
var context = this;
|
|
262
|
+
function handle(loc, caught) {
|
|
263
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
264
|
+
}
|
|
265
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
266
|
+
var entry = this.tryEntries[i],
|
|
267
|
+
record = entry.completion;
|
|
268
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
269
|
+
if (entry.tryLoc <= this.prev) {
|
|
270
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
271
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
272
|
+
if (hasCatch && hasFinally) {
|
|
273
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
274
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
275
|
+
} else if (hasCatch) {
|
|
276
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
277
|
+
} else {
|
|
278
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
279
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
abrupt: function (type, arg) {
|
|
285
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
286
|
+
var entry = this.tryEntries[i];
|
|
287
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
288
|
+
var finallyEntry = entry;
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
293
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
294
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
295
|
+
},
|
|
296
|
+
complete: function (record, afterLoc) {
|
|
297
|
+
if ("throw" === record.type) throw record.arg;
|
|
298
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
299
|
+
},
|
|
300
|
+
finish: function (finallyLoc) {
|
|
301
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
302
|
+
var entry = this.tryEntries[i];
|
|
303
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
catch: function (tryLoc) {
|
|
307
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
308
|
+
var entry = this.tryEntries[i];
|
|
309
|
+
if (entry.tryLoc === tryLoc) {
|
|
310
|
+
var record = entry.completion;
|
|
311
|
+
if ("throw" === record.type) {
|
|
312
|
+
var thrown = record.arg;
|
|
313
|
+
resetTryEntry(entry);
|
|
314
|
+
}
|
|
315
|
+
return thrown;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
throw new Error("illegal catch attempt");
|
|
319
|
+
},
|
|
320
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
321
|
+
return this.delegate = {
|
|
322
|
+
iterator: values(iterable),
|
|
323
|
+
resultName: resultName,
|
|
324
|
+
nextLoc: nextLoc
|
|
325
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
326
|
+
}
|
|
327
|
+
}, exports;
|
|
328
|
+
}
|
|
33
329
|
function _typeof$1(obj) {
|
|
34
330
|
"@babel/helpers - typeof";
|
|
35
331
|
|
|
@@ -39,7 +335,6 @@
|
|
|
39
335
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
40
336
|
}, _typeof$1(obj);
|
|
41
337
|
}
|
|
42
|
-
|
|
43
338
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
44
339
|
try {
|
|
45
340
|
var info = gen[key](arg);
|
|
@@ -48,50 +343,42 @@
|
|
|
48
343
|
reject(error);
|
|
49
344
|
return;
|
|
50
345
|
}
|
|
51
|
-
|
|
52
346
|
if (info.done) {
|
|
53
347
|
resolve(value);
|
|
54
348
|
} else {
|
|
55
349
|
Promise.resolve(value).then(_next, _throw);
|
|
56
350
|
}
|
|
57
351
|
}
|
|
58
|
-
|
|
59
352
|
function _asyncToGenerator(fn) {
|
|
60
353
|
return function () {
|
|
61
354
|
var self = this,
|
|
62
|
-
|
|
355
|
+
args = arguments;
|
|
63
356
|
return new Promise(function (resolve, reject) {
|
|
64
357
|
var gen = fn.apply(self, args);
|
|
65
|
-
|
|
66
358
|
function _next(value) {
|
|
67
359
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
68
360
|
}
|
|
69
|
-
|
|
70
361
|
function _throw(err) {
|
|
71
362
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
72
363
|
}
|
|
73
|
-
|
|
74
364
|
_next(undefined);
|
|
75
365
|
});
|
|
76
366
|
};
|
|
77
367
|
}
|
|
78
|
-
|
|
79
368
|
function _classCallCheck$1(instance, Constructor) {
|
|
80
369
|
if (!(instance instanceof Constructor)) {
|
|
81
370
|
throw new TypeError("Cannot call a class as a function");
|
|
82
371
|
}
|
|
83
372
|
}
|
|
84
|
-
|
|
85
373
|
function _defineProperties$1(target, props) {
|
|
86
374
|
for (var i = 0; i < props.length; i++) {
|
|
87
375
|
var descriptor = props[i];
|
|
88
376
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
89
377
|
descriptor.configurable = true;
|
|
90
378
|
if ("value" in descriptor) descriptor.writable = true;
|
|
91
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
379
|
+
Object.defineProperty(target, _toPropertyKey$1(descriptor.key), descriptor);
|
|
92
380
|
}
|
|
93
381
|
}
|
|
94
|
-
|
|
95
382
|
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
96
383
|
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
|
97
384
|
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
|
@@ -100,8 +387,8 @@
|
|
|
100
387
|
});
|
|
101
388
|
return Constructor;
|
|
102
389
|
}
|
|
103
|
-
|
|
104
390
|
function _defineProperty$1(obj, key, value) {
|
|
391
|
+
key = _toPropertyKey$1(key);
|
|
105
392
|
if (key in obj) {
|
|
106
393
|
Object.defineProperty(obj, key, {
|
|
107
394
|
value: value,
|
|
@@ -112,22 +399,17 @@
|
|
|
112
399
|
} else {
|
|
113
400
|
obj[key] = value;
|
|
114
401
|
}
|
|
115
|
-
|
|
116
402
|
return obj;
|
|
117
403
|
}
|
|
118
|
-
|
|
119
404
|
function _toConsumableArray$1(arr) {
|
|
120
405
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread();
|
|
121
406
|
}
|
|
122
|
-
|
|
123
407
|
function _arrayWithoutHoles(arr) {
|
|
124
408
|
if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
|
|
125
409
|
}
|
|
126
|
-
|
|
127
410
|
function _iterableToArray(iter) {
|
|
128
411
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
129
412
|
}
|
|
130
|
-
|
|
131
413
|
function _unsupportedIterableToArray$1(o, minLen) {
|
|
132
414
|
if (!o) return;
|
|
133
415
|
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
|
@@ -136,32 +418,39 @@
|
|
|
136
418
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
137
419
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
|
138
420
|
}
|
|
139
|
-
|
|
140
421
|
function _arrayLikeToArray$1(arr, len) {
|
|
141
422
|
if (len == null || len > arr.length) len = arr.length;
|
|
142
|
-
|
|
143
423
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
144
|
-
|
|
145
424
|
return arr2;
|
|
146
425
|
}
|
|
147
|
-
|
|
148
426
|
function _nonIterableSpread() {
|
|
149
427
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
150
428
|
}
|
|
429
|
+
function _toPrimitive(input, hint) {
|
|
430
|
+
if (typeof input !== "object" || input === null) return input;
|
|
431
|
+
var prim = input[Symbol.toPrimitive];
|
|
432
|
+
if (prim !== undefined) {
|
|
433
|
+
var res = prim.call(input, hint || "default");
|
|
434
|
+
if (typeof res !== "object") return res;
|
|
435
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
436
|
+
}
|
|
437
|
+
return (hint === "string" ? String : Number)(input);
|
|
438
|
+
}
|
|
439
|
+
function _toPropertyKey$1(arg) {
|
|
440
|
+
var key = _toPrimitive(arg, "string");
|
|
441
|
+
return typeof key === "symbol" ? key : String(key);
|
|
442
|
+
}
|
|
151
443
|
|
|
152
444
|
function ownKeys(e, t) {
|
|
153
445
|
var r = Object.keys(e);
|
|
154
|
-
|
|
155
446
|
if (Object.getOwnPropertySymbols) {
|
|
156
447
|
var n = Object.getOwnPropertySymbols(e);
|
|
157
448
|
t && (n = n.filter(function (t) {
|
|
158
449
|
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
159
450
|
})), r.push.apply(r, n);
|
|
160
451
|
}
|
|
161
|
-
|
|
162
452
|
return r;
|
|
163
453
|
}
|
|
164
|
-
|
|
165
454
|
function _objectSpread2(e) {
|
|
166
455
|
for (var t = 1; t < arguments.length; t++) {
|
|
167
456
|
var r = null != arguments[t] ? arguments[t] : {};
|
|
@@ -171,76 +460,70 @@
|
|
|
171
460
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
172
461
|
});
|
|
173
462
|
}
|
|
174
|
-
|
|
175
463
|
return e;
|
|
176
464
|
}
|
|
177
|
-
|
|
178
465
|
function _typeof(e) {
|
|
179
|
-
return
|
|
466
|
+
return _typeof = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
|
|
180
467
|
return _typeof$1(e);
|
|
181
468
|
} : function (e) {
|
|
182
469
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
|
|
183
|
-
}
|
|
470
|
+
}, _typeof(e);
|
|
184
471
|
}
|
|
185
|
-
|
|
186
472
|
function _classCallCheck(e, t) {
|
|
187
473
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
188
474
|
}
|
|
189
|
-
|
|
190
475
|
function _defineProperties(e, t) {
|
|
191
476
|
for (var r = 0; r < t.length; r++) {
|
|
192
477
|
var n = t[r];
|
|
193
|
-
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
|
|
478
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, _toPropertyKey(n.key), n);
|
|
194
479
|
}
|
|
195
480
|
}
|
|
196
|
-
|
|
197
481
|
function _createClass(e, t, r) {
|
|
198
482
|
return t && _defineProperties(e.prototype, t), r && _defineProperties(e, r), Object.defineProperty(e, "prototype", {
|
|
199
483
|
writable: !1
|
|
200
484
|
}), e;
|
|
201
485
|
}
|
|
202
|
-
|
|
203
486
|
function _defineProperty(e, t, r) {
|
|
204
|
-
return t in e ? Object.defineProperty(e, t, {
|
|
487
|
+
return (t = _toPropertyKey(t)) in e ? Object.defineProperty(e, t, {
|
|
205
488
|
value: r,
|
|
206
489
|
enumerable: !0,
|
|
207
490
|
configurable: !0,
|
|
208
491
|
writable: !0
|
|
209
492
|
}) : e[t] = r, e;
|
|
210
493
|
}
|
|
211
|
-
|
|
212
494
|
function _slicedToArray(e, t) {
|
|
213
495
|
return function _arrayWithHoles(e) {
|
|
214
496
|
if (Array.isArray(e)) return e;
|
|
215
497
|
}(e) || function _iterableToArrayLimit(e, t) {
|
|
216
498
|
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
217
|
-
if (null
|
|
218
|
-
|
|
499
|
+
if (null != r) {
|
|
500
|
+
var n,
|
|
501
|
+
o,
|
|
219
502
|
a,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
try {
|
|
225
|
-
for (r = r.call(e); !(i = (n = r.next()).done) && (o.push(n.value), !t || o.length !== t); i = !0) {
|
|
226
|
-
;
|
|
227
|
-
}
|
|
228
|
-
} catch (e) {
|
|
229
|
-
c = !0, a = e;
|
|
230
|
-
} finally {
|
|
503
|
+
i,
|
|
504
|
+
c = [],
|
|
505
|
+
s = !0,
|
|
506
|
+
u = !1;
|
|
231
507
|
try {
|
|
232
|
-
|
|
508
|
+
if (a = (r = r.call(e)).next, 0 === t) {
|
|
509
|
+
if (Object(r) !== r) return;
|
|
510
|
+
s = !1;
|
|
511
|
+
} else for (; !(s = (n = a.call(r)).done) && (c.push(n.value), c.length !== t); s = !0);
|
|
512
|
+
} catch (e) {
|
|
513
|
+
u = !0, o = e;
|
|
233
514
|
} finally {
|
|
234
|
-
|
|
515
|
+
try {
|
|
516
|
+
if (!s && null != r["return"] && (i = r["return"](), Object(i) !== i)) return;
|
|
517
|
+
} finally {
|
|
518
|
+
if (u) throw o;
|
|
519
|
+
}
|
|
235
520
|
}
|
|
521
|
+
return c;
|
|
236
522
|
}
|
|
237
|
-
|
|
238
|
-
return o;
|
|
239
523
|
}(e, t) || _unsupportedIterableToArray(e, t) || function _nonIterableRest() {
|
|
240
524
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
241
525
|
}();
|
|
242
526
|
}
|
|
243
|
-
|
|
244
527
|
function _toConsumableArray(e) {
|
|
245
528
|
return function _arrayWithoutHoles(e) {
|
|
246
529
|
if (Array.isArray(e)) return _arrayLikeToArray(e);
|
|
@@ -250,7 +533,6 @@
|
|
|
250
533
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
251
534
|
}();
|
|
252
535
|
}
|
|
253
|
-
|
|
254
536
|
function _unsupportedIterableToArray(e, t) {
|
|
255
537
|
if (e) {
|
|
256
538
|
if ("string" == typeof e) return _arrayLikeToArray(e, t);
|
|
@@ -258,29 +540,35 @@
|
|
|
258
540
|
return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _arrayLikeToArray(e, t) : void 0;
|
|
259
541
|
}
|
|
260
542
|
}
|
|
261
|
-
|
|
262
543
|
function _arrayLikeToArray(e, t) {
|
|
263
544
|
(null == t || t > e.length) && (t = e.length);
|
|
264
|
-
|
|
265
|
-
for (var r = 0, n = new Array(t); r < t; r++) {
|
|
266
|
-
n[r] = e[r];
|
|
267
|
-
}
|
|
268
|
-
|
|
545
|
+
for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
|
|
269
546
|
return n;
|
|
270
547
|
}
|
|
271
|
-
|
|
548
|
+
function _toPropertyKey(e) {
|
|
549
|
+
var t = function _toPrimitive(e, t) {
|
|
550
|
+
if ("object" != _typeof$1(e) || null === e) return e;
|
|
551
|
+
var r = e[Symbol.toPrimitive];
|
|
552
|
+
if (void 0 !== r) {
|
|
553
|
+
var n = r.call(e, t || "default");
|
|
554
|
+
if ("object" != _typeof$1(n)) return n;
|
|
555
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
556
|
+
}
|
|
557
|
+
return ("string" === t ? String : Number)(e);
|
|
558
|
+
}(e, "string");
|
|
559
|
+
return "symbol" == _typeof$1(t) ? t : String(t);
|
|
560
|
+
}
|
|
272
561
|
var e = _createClass(function TypesonPromise(e) {
|
|
273
562
|
_classCallCheck(this, TypesonPromise), this.p = new Promise(e);
|
|
274
563
|
});
|
|
275
|
-
|
|
276
564
|
e.__typeson__type__ = "TypesonPromise", "undefined" != typeof Symbol && (e.prototype[Symbol.toStringTag] = "TypesonPromise"), e.prototype.then = function (t, r) {
|
|
277
565
|
var n = this;
|
|
278
|
-
return new e(function (e,
|
|
566
|
+
return new e(function (e, o) {
|
|
279
567
|
n.p.then(function (r) {
|
|
280
568
|
e(t ? t(r) : r);
|
|
281
569
|
})["catch"](function (e) {
|
|
282
570
|
return r ? r(e) : Promise.reject(e);
|
|
283
|
-
}).then(e,
|
|
571
|
+
}).then(e, o);
|
|
284
572
|
});
|
|
285
573
|
}, e.prototype["catch"] = function (e) {
|
|
286
574
|
return this.then(null, e);
|
|
@@ -302,85 +590,66 @@
|
|
|
302
590
|
};
|
|
303
591
|
});
|
|
304
592
|
var t = {}.toString,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
593
|
+
r = {}.hasOwnProperty,
|
|
594
|
+
n = Object.getPrototypeOf,
|
|
595
|
+
o = r.toString;
|
|
309
596
|
function isThenable(e, t) {
|
|
310
597
|
return isObject(e) && "function" == typeof e.then && (!t || "function" == typeof e["catch"]);
|
|
311
598
|
}
|
|
312
|
-
|
|
313
599
|
function toStringTag(e) {
|
|
314
600
|
return t.call(e).slice(8, -1);
|
|
315
601
|
}
|
|
316
|
-
|
|
317
602
|
function hasConstructorOf(e, t) {
|
|
318
603
|
if (!e || "object" !== _typeof(e)) return !1;
|
|
319
|
-
var
|
|
320
|
-
if (!
|
|
321
|
-
var i = r.call(
|
|
322
|
-
return "function" != typeof i ? null === t : t === i || null !== t &&
|
|
604
|
+
var a = n(e);
|
|
605
|
+
if (!a) return null === t;
|
|
606
|
+
var i = r.call(a, "constructor") && a.constructor;
|
|
607
|
+
return "function" != typeof i ? null === t : t === i || null !== t && o.call(i) === o.call(t) || "function" == typeof t && "string" == typeof i.__typeson__type__ && i.__typeson__type__ === t.__typeson__type__;
|
|
323
608
|
}
|
|
324
|
-
|
|
325
609
|
function isPlainObject(e) {
|
|
326
610
|
return !(!e || "Object" !== toStringTag(e)) && (!n(e) || hasConstructorOf(e, Object));
|
|
327
611
|
}
|
|
328
|
-
|
|
329
612
|
function isUserObject(e) {
|
|
330
613
|
if (!e || "Object" !== toStringTag(e)) return !1;
|
|
331
614
|
var t = n(e);
|
|
332
615
|
return !t || hasConstructorOf(e, Object) || isUserObject(t);
|
|
333
616
|
}
|
|
334
|
-
|
|
335
617
|
function isObject(e) {
|
|
336
618
|
return e && "object" === _typeof(e);
|
|
337
619
|
}
|
|
338
|
-
|
|
339
620
|
function escapeKeyPathComponent(e) {
|
|
340
|
-
return e.replace(/~/g, "~0").replace(/\./g, "~1");
|
|
621
|
+
return e.replace(/''/g, "''''").replace(/^$/, "''").replace(/~/g, "~0").replace(/\./g, "~1");
|
|
341
622
|
}
|
|
342
|
-
|
|
343
623
|
function unescapeKeyPathComponent(e) {
|
|
344
|
-
return e.replace(/~1/g, ".").replace(/~0/g, "~");
|
|
624
|
+
return e.replace(/~1/g, ".").replace(/~0/g, "~").replace(/^''$/, "").replace(/''''/g, "''");
|
|
345
625
|
}
|
|
346
|
-
|
|
347
626
|
function getByKeyPath(e, t) {
|
|
348
627
|
if ("" === t) return e;
|
|
349
628
|
var r = t.indexOf(".");
|
|
350
|
-
|
|
351
629
|
if (r > -1) {
|
|
352
630
|
var n = e[unescapeKeyPathComponent(t.slice(0, r))];
|
|
353
631
|
return void 0 === n ? void 0 : getByKeyPath(n, t.slice(r + 1));
|
|
354
632
|
}
|
|
355
|
-
|
|
356
633
|
return e[unescapeKeyPathComponent(t)];
|
|
357
634
|
}
|
|
358
|
-
|
|
359
635
|
function setAtKeyPath(e, t, r) {
|
|
360
636
|
if ("" === t) return r;
|
|
361
637
|
var n = t.indexOf(".");
|
|
362
638
|
return n > -1 ? setAtKeyPath(e[unescapeKeyPathComponent(t.slice(0, n))], t.slice(n + 1), r) : (e[unescapeKeyPathComponent(t)] = r, e);
|
|
363
639
|
}
|
|
364
|
-
|
|
365
640
|
function getJSONType(e) {
|
|
366
641
|
return null === e ? "null" : Array.isArray(e) ? "array" : _typeof(e);
|
|
367
642
|
}
|
|
368
|
-
|
|
369
643
|
function _await(e, t, r) {
|
|
370
644
|
return r ? t ? t(e) : e : (e && e.then || (e = Promise.resolve(e)), t ? e.then(t) : e);
|
|
371
645
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
s = ["type", "replaced", "iterateIn", "iterateUnsetNumeric"];
|
|
377
|
-
|
|
646
|
+
var a = Object.keys,
|
|
647
|
+
i$1 = Array.isArray,
|
|
648
|
+
c = {}.hasOwnProperty,
|
|
649
|
+
s = ["type", "replaced", "iterateIn", "iterateUnsetNumeric"];
|
|
378
650
|
function _async(e) {
|
|
379
651
|
return function () {
|
|
380
|
-
for (var t = [], r = 0; r < arguments.length; r++)
|
|
381
|
-
t[r] = arguments[r];
|
|
382
|
-
}
|
|
383
|
-
|
|
652
|
+
for (var t = [], r = 0; r < arguments.length; r++) t[r] = arguments[r];
|
|
384
653
|
try {
|
|
385
654
|
return Promise.resolve(e.apply(this, t));
|
|
386
655
|
} catch (e) {
|
|
@@ -388,533 +657,475 @@
|
|
|
388
657
|
}
|
|
389
658
|
};
|
|
390
659
|
}
|
|
391
|
-
|
|
392
660
|
function nestedPathsFirst(e, t) {
|
|
393
661
|
if ("" === e.keypath) return -1;
|
|
394
662
|
var r = e.keypath.match(/\./g) || 0,
|
|
395
|
-
|
|
663
|
+
n = t.keypath.match(/\./g) || 0;
|
|
396
664
|
return r && (r = r.length), n && (n = n.length), r > n ? -1 : r < n ? 1 : e.keypath < t.keypath ? -1 : e.keypath > t.keypath;
|
|
397
665
|
}
|
|
398
|
-
|
|
399
666
|
var u = function () {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
return _createClass(Typeson, [{
|
|
405
|
-
key: "stringify",
|
|
406
|
-
value: function stringify(e, t, r, n) {
|
|
407
|
-
n = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), n), {}, {
|
|
408
|
-
stringification: !0
|
|
409
|
-
});
|
|
410
|
-
var a = this.encapsulate(e, null, n);
|
|
411
|
-
return i$1(a) ? JSON.stringify(a[0], t, r) : a.then(function (e) {
|
|
412
|
-
return JSON.stringify(e, t, r);
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
}, {
|
|
416
|
-
key: "stringifySync",
|
|
417
|
-
value: function stringifySync(e, t, r, n) {
|
|
418
|
-
return this.stringify(e, t, r, _objectSpread2(_objectSpread2({
|
|
419
|
-
throwOnBadSyncType: !0
|
|
420
|
-
}, n), {}, {
|
|
421
|
-
sync: !0
|
|
422
|
-
}));
|
|
423
|
-
}
|
|
424
|
-
}, {
|
|
425
|
-
key: "stringifyAsync",
|
|
426
|
-
value: function stringifyAsync(e, t, r, n) {
|
|
427
|
-
return this.stringify(e, t, r, _objectSpread2(_objectSpread2({
|
|
428
|
-
throwOnBadSyncType: !0
|
|
429
|
-
}, n), {}, {
|
|
430
|
-
sync: !1
|
|
431
|
-
}));
|
|
432
|
-
}
|
|
433
|
-
}, {
|
|
434
|
-
key: "parse",
|
|
435
|
-
value: function parse(e, t, r) {
|
|
436
|
-
return r = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), r), {}, {
|
|
437
|
-
parse: !0
|
|
438
|
-
}), this.revive(JSON.parse(e, t), r);
|
|
667
|
+
function Typeson(e) {
|
|
668
|
+
_classCallCheck(this, Typeson), this.options = e, this.plainObjectReplacers = [], this.nonplainObjectReplacers = [], this.revivers = {}, this.types = {};
|
|
439
669
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
670
|
+
return _createClass(Typeson, [{
|
|
671
|
+
key: "stringify",
|
|
672
|
+
value: function stringify(e, t, r, n) {
|
|
673
|
+
n = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), n), {}, {
|
|
674
|
+
stringification: !0
|
|
675
|
+
});
|
|
676
|
+
var o = this.encapsulate(e, null, n);
|
|
677
|
+
return i$1(o) ? JSON.stringify(o[0], t, r) : o.then(function (e) {
|
|
678
|
+
return JSON.stringify(e, t, r);
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
}, {
|
|
682
|
+
key: "stringifySync",
|
|
683
|
+
value: function stringifySync(e, t, r, n) {
|
|
684
|
+
return this.stringify(e, t, r, _objectSpread2(_objectSpread2({
|
|
685
|
+
throwOnBadSyncType: !0
|
|
686
|
+
}, n), {}, {
|
|
687
|
+
sync: !0
|
|
688
|
+
}));
|
|
689
|
+
}
|
|
690
|
+
}, {
|
|
691
|
+
key: "stringifyAsync",
|
|
692
|
+
value: function stringifyAsync(e, t, r, n) {
|
|
693
|
+
return this.stringify(e, t, r, _objectSpread2(_objectSpread2({
|
|
694
|
+
throwOnBadSyncType: !0
|
|
695
|
+
}, n), {}, {
|
|
696
|
+
sync: !1
|
|
697
|
+
}));
|
|
698
|
+
}
|
|
699
|
+
}, {
|
|
700
|
+
key: "parse",
|
|
701
|
+
value: function parse(e, t, r) {
|
|
702
|
+
return r = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), r), {}, {
|
|
703
|
+
parse: !0
|
|
704
|
+
}), this.revive(JSON.parse(e, t), r);
|
|
705
|
+
}
|
|
706
|
+
}, {
|
|
707
|
+
key: "parseSync",
|
|
708
|
+
value: function parseSync(e, t, r) {
|
|
709
|
+
return this.parse(e, t, _objectSpread2(_objectSpread2({
|
|
710
|
+
throwOnBadSyncType: !0
|
|
711
|
+
}, r), {}, {
|
|
712
|
+
sync: !0
|
|
713
|
+
}));
|
|
714
|
+
}
|
|
715
|
+
}, {
|
|
716
|
+
key: "parseAsync",
|
|
717
|
+
value: function parseAsync(e, t, r) {
|
|
718
|
+
return this.parse(e, t, _objectSpread2(_objectSpread2({
|
|
719
|
+
throwOnBadSyncType: !0
|
|
720
|
+
}, r), {}, {
|
|
721
|
+
sync: !1
|
|
722
|
+
}));
|
|
723
|
+
}
|
|
724
|
+
}, {
|
|
725
|
+
key: "specialTypeNames",
|
|
726
|
+
value: function specialTypeNames(e, t) {
|
|
727
|
+
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
|
|
728
|
+
return r.returnTypeNames = !0, this.encapsulate(e, t, r);
|
|
729
|
+
}
|
|
730
|
+
}, {
|
|
731
|
+
key: "rootTypeName",
|
|
732
|
+
value: function rootTypeName(e, t) {
|
|
733
|
+
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
|
|
734
|
+
return r.iterateNone = !0, this.encapsulate(e, t, r);
|
|
735
|
+
}
|
|
736
|
+
}, {
|
|
737
|
+
key: "encapsulate",
|
|
738
|
+
value: function encapsulate(t, r, n) {
|
|
739
|
+
var o = _async(function (t, r) {
|
|
740
|
+
return _await(Promise.all(r.map(function (e) {
|
|
741
|
+
return e[1].p;
|
|
742
|
+
})), function (n) {
|
|
743
|
+
return _await(Promise.all(n.map(_async(function (n) {
|
|
744
|
+
var a = !1,
|
|
745
|
+
i = [],
|
|
746
|
+
c = _slicedToArray(r.splice(0, 1), 1),
|
|
747
|
+
s = _slicedToArray(c[0], 7),
|
|
748
|
+
u = s[0],
|
|
749
|
+
p = s[2],
|
|
750
|
+
l = s[3],
|
|
751
|
+
y = s[4],
|
|
752
|
+
f = s[5],
|
|
753
|
+
h = s[6],
|
|
754
|
+
v = _encapsulate(u, n, p, l, i, !0, h),
|
|
755
|
+
b = hasConstructorOf(v, e);
|
|
756
|
+
return function _invoke(e, t) {
|
|
757
|
+
var r = e();
|
|
758
|
+
return r && r.then ? r.then(t) : t(r);
|
|
759
|
+
}(function () {
|
|
760
|
+
if (u && b) return _await(v.p, function (e) {
|
|
761
|
+
y[f] = e;
|
|
762
|
+
var r = o(t, i);
|
|
763
|
+
return a = !0, r;
|
|
764
|
+
});
|
|
765
|
+
}, function (e) {
|
|
766
|
+
return a ? e : (u ? y[f] = v : t = b ? v.p : v, o(t, i));
|
|
767
|
+
});
|
|
768
|
+
}))), function () {
|
|
769
|
+
return t;
|
|
499
770
|
});
|
|
500
|
-
}, function (e) {
|
|
501
|
-
return o ? e : (u ? l[f] = v : t = d ? v.p : v, a(t, i));
|
|
502
771
|
});
|
|
503
|
-
})
|
|
504
|
-
return t;
|
|
505
|
-
});
|
|
506
|
-
});
|
|
507
|
-
}),
|
|
772
|
+
}),
|
|
508
773
|
u = (n = _objectSpread2(_objectSpread2({
|
|
509
|
-
|
|
510
|
-
|
|
774
|
+
sync: !0
|
|
775
|
+
}, this.options), n)).sync,
|
|
511
776
|
p = this,
|
|
512
|
-
|
|
513
|
-
|
|
777
|
+
l = {},
|
|
778
|
+
y = [],
|
|
514
779
|
f = [],
|
|
515
780
|
h = [],
|
|
516
781
|
v = !("cyclic" in n) || n.cyclic,
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
782
|
+
b = n.encapsulateObserver,
|
|
783
|
+
d = _encapsulate("", t, v, r || {}, h);
|
|
784
|
+
function finish(e) {
|
|
785
|
+
var t = Object.values(l);
|
|
786
|
+
if (n.iterateNone) return t.length ? t[0] : getJSONType(e);
|
|
787
|
+
if (t.length) {
|
|
788
|
+
if (n.returnTypeNames) return _toConsumableArray(new Set(t));
|
|
789
|
+
e && isPlainObject(e) && !c.call(e, "$types") ? e.$types = l : e = {
|
|
790
|
+
$: e,
|
|
791
|
+
$types: {
|
|
792
|
+
$: l
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
} else isObject(e) && c.call(e, "$types") && (e = {
|
|
527
796
|
$: e,
|
|
528
|
-
$types:
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
var
|
|
544
|
-
return delete e[t], r;
|
|
545
|
-
});
|
|
546
|
-
r(), s.forEach(function (t, r) {
|
|
547
|
-
e[t] = n[r];
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
function _encapsulate(t, r, a, s, u, h, v) {
|
|
552
|
-
var b,
|
|
797
|
+
$types: !0
|
|
798
|
+
});
|
|
799
|
+
return !n.returnTypeNames && e;
|
|
800
|
+
}
|
|
801
|
+
function _adaptBuiltinStateObjectProperties(e, t, r) {
|
|
802
|
+
Object.assign(e, t);
|
|
803
|
+
var n = s.map(function (t) {
|
|
804
|
+
var r = e[t];
|
|
805
|
+
return delete e[t], r;
|
|
806
|
+
});
|
|
807
|
+
r(), s.forEach(function (t, r) {
|
|
808
|
+
e[t] = n[r];
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
function _encapsulate(t, r, o, s, u, h, v) {
|
|
812
|
+
var d,
|
|
553
813
|
_ = {},
|
|
554
814
|
O = _typeof(r),
|
|
555
|
-
j =
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
var S,
|
|
584
|
-
g = isPlainObject(r),
|
|
815
|
+
j = b ? function (n) {
|
|
816
|
+
var a = v || s.type || getJSONType(r);
|
|
817
|
+
b(Object.assign(n || _, {
|
|
818
|
+
keypath: t,
|
|
819
|
+
value: r,
|
|
820
|
+
cyclic: o,
|
|
821
|
+
stateObj: s,
|
|
822
|
+
promisesData: u,
|
|
823
|
+
resolvingTypesonPromise: h,
|
|
824
|
+
awaitingTypesonPromise: hasConstructorOf(r, e)
|
|
825
|
+
}, {
|
|
826
|
+
type: a
|
|
827
|
+
}));
|
|
828
|
+
} : null;
|
|
829
|
+
if (["string", "boolean", "number", "undefined"].includes(O)) return void 0 === r || Number.isNaN(r) || r === Number.NEGATIVE_INFINITY || r === Number.POSITIVE_INFINITY ? (d = s.replaced ? r : replace(t, r, s, u, !1, h, j)) !== r && (_ = {
|
|
830
|
+
replaced: d
|
|
831
|
+
}) : d = r, j && j(), d;
|
|
832
|
+
if (null === r) return j && j(), r;
|
|
833
|
+
if (o && !s.iterateIn && !s.iterateUnsetNumeric && r && "object" === _typeof(r)) {
|
|
834
|
+
var m = y.indexOf(r);
|
|
835
|
+
if (!(m < 0)) return l[t] = "#", j && j({
|
|
836
|
+
cyclicKeypath: f[m]
|
|
837
|
+
}), "#" + f[m];
|
|
838
|
+
!0 === o && (y.push(r), f.push(t));
|
|
839
|
+
}
|
|
840
|
+
var g,
|
|
841
|
+
S = isPlainObject(r),
|
|
585
842
|
P = i$1(r),
|
|
586
|
-
T = (
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
843
|
+
T = (S || P) && (!p.plainObjectReplacers.length || s.replaced) || s.iterateIn ? r : replace(t, r, s, u, S || P, null, j);
|
|
844
|
+
if (T !== r ? (d = T, _ = {
|
|
845
|
+
replaced: T
|
|
846
|
+
}) : "" === t && hasConstructorOf(r, e) ? (u.push([t, r, o, s, void 0, void 0, s.type]), d = r) : P && "object" !== s.iterateIn || "array" === s.iterateIn ? (g = new Array(r.length), _ = {
|
|
847
|
+
clone: g
|
|
848
|
+
}) : (["function", "symbol"].includes(_typeof(r)) || "toJSON" in r || hasConstructorOf(r, e) || hasConstructorOf(r, Promise) || hasConstructorOf(r, ArrayBuffer)) && !S && "object" !== s.iterateIn ? d = r : (g = {}, s.addLength && (g.length = r.length), _ = {
|
|
849
|
+
clone: g
|
|
850
|
+
}), j && j(), n.iterateNone) return g || d;
|
|
851
|
+
if (!g) return d;
|
|
852
|
+
if (s.iterateIn) {
|
|
853
|
+
var w = function _loop(n) {
|
|
854
|
+
var a = {
|
|
855
|
+
ownKeys: c.call(r, n)
|
|
856
|
+
};
|
|
857
|
+
_adaptBuiltinStateObjectProperties(s, a, function () {
|
|
858
|
+
var a = t + (t ? "." : "") + escapeKeyPathComponent(n),
|
|
859
|
+
i = _encapsulate(a, r[n], Boolean(o), s, u, h);
|
|
860
|
+
hasConstructorOf(i, e) ? u.push([a, i, Boolean(o), s, g, n, s.type]) : void 0 !== i && (g[n] = i);
|
|
861
|
+
});
|
|
600
862
|
};
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
hasConstructorOf(i, e) ? u.push([o, i, Boolean(a), s, S, n, s.type]) : void 0 !== i && (S[n] = i);
|
|
863
|
+
for (var A in r) w(A);
|
|
864
|
+
j && j({
|
|
865
|
+
endIterateIn: !0,
|
|
866
|
+
end: !0
|
|
607
867
|
});
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
868
|
+
} else a(r).forEach(function (n) {
|
|
869
|
+
var a = t + (t ? "." : "") + escapeKeyPathComponent(n);
|
|
870
|
+
_adaptBuiltinStateObjectProperties(s, {
|
|
871
|
+
ownKeys: !0
|
|
872
|
+
}, function () {
|
|
873
|
+
var t = _encapsulate(a, r[n], Boolean(o), s, u, h);
|
|
874
|
+
hasConstructorOf(t, e) ? u.push([a, t, Boolean(o), s, g, n, s.type]) : void 0 !== t && (g[n] = t);
|
|
875
|
+
});
|
|
876
|
+
}), j && j({
|
|
877
|
+
endIterateOwn: !0,
|
|
616
878
|
end: !0
|
|
617
879
|
});
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
for (var C = r.length, k = function _loop2(n) {
|
|
635
|
-
if (!(n in r)) {
|
|
636
|
-
var o = t + (t ? "." : "") + n;
|
|
637
|
-
|
|
638
|
-
_adaptBuiltinStateObjectProperties(s, {
|
|
639
|
-
ownKeys: !1
|
|
640
|
-
}, function () {
|
|
641
|
-
var t = _encapsulate(o, void 0, Boolean(a), s, u, h);
|
|
642
|
-
|
|
643
|
-
hasConstructorOf(t, e) ? u.push([o, t, Boolean(a), s, S, n, s.type]) : void 0 !== t && (S[n] = t);
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
}, N = 0; N < C; N++) {
|
|
647
|
-
k(N);
|
|
880
|
+
if (s.iterateUnsetNumeric) {
|
|
881
|
+
for (var C = r.length, k = function _loop2(n) {
|
|
882
|
+
if (!(n in r)) {
|
|
883
|
+
var a = t + (t ? "." : "") + n;
|
|
884
|
+
_adaptBuiltinStateObjectProperties(s, {
|
|
885
|
+
ownKeys: !1
|
|
886
|
+
}, function () {
|
|
887
|
+
var t = _encapsulate(a, void 0, Boolean(o), s, u, h);
|
|
888
|
+
hasConstructorOf(t, e) ? u.push([a, t, Boolean(o), s, g, n, s.type]) : void 0 !== t && (g[n] = t);
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
}, N = 0; N < C; N++) k(N);
|
|
892
|
+
j && j({
|
|
893
|
+
endIterateUnsetNumeric: !0,
|
|
894
|
+
end: !0
|
|
895
|
+
});
|
|
648
896
|
}
|
|
649
|
-
|
|
650
|
-
j && j({
|
|
651
|
-
endIterateUnsetNumeric: !0,
|
|
652
|
-
end: !0
|
|
653
|
-
});
|
|
897
|
+
return g;
|
|
654
898
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
899
|
+
function replace(e, t, r, n, o, a, i) {
|
|
900
|
+
for (var c = o ? p.plainObjectReplacers : p.nonplainObjectReplacers, s = c.length; s--;) {
|
|
901
|
+
var y = c[s];
|
|
902
|
+
if (y.test(t, r)) {
|
|
903
|
+
var f = y.type;
|
|
904
|
+
if (p.revivers[f]) {
|
|
905
|
+
var h = l[e];
|
|
906
|
+
l[e] = h ? [f].concat(h) : f;
|
|
907
|
+
}
|
|
908
|
+
return Object.assign(r, {
|
|
909
|
+
type: f,
|
|
910
|
+
replaced: !0
|
|
911
|
+
}), !u && y.replaceAsync || y.replace ? (i && i({
|
|
912
|
+
replacing: !0
|
|
913
|
+
}), _encapsulate(e, y[u || !y.replaceAsync ? "replace" : "replaceAsync"](t, r), v && "readonly", r, n, a, f)) : (i && i({
|
|
914
|
+
typeDetected: !0
|
|
915
|
+
}), _encapsulate(e, t, v && "readonly", r, n, a, f));
|
|
669
916
|
}
|
|
670
|
-
|
|
671
|
-
return Object.assign(r, {
|
|
672
|
-
type: f,
|
|
673
|
-
replaced: !0
|
|
674
|
-
}), !u && l.replaceAsync || l.replace ? (i && i({
|
|
675
|
-
replacing: !0
|
|
676
|
-
}), _encapsulate(e, l[u || !l.replaceAsync ? "replace" : "replaceAsync"](t, r), v && "readonly", r, n, o, f)) : (i && i({
|
|
677
|
-
typeDetected: !0
|
|
678
|
-
}), _encapsulate(e, t, v && "readonly", r, n, o, f));
|
|
679
917
|
}
|
|
918
|
+
return t;
|
|
680
919
|
}
|
|
681
|
-
|
|
682
|
-
|
|
920
|
+
return h.length ? u && n.throwOnBadSyncType ? function () {
|
|
921
|
+
throw new TypeError("Sync method requested but async result obtained");
|
|
922
|
+
}() : Promise.resolve(o(d, h)).then(finish) : !u && n.throwOnBadSyncType ? function () {
|
|
923
|
+
throw new TypeError("Async method requested but sync result obtained");
|
|
924
|
+
}() : n.stringification && u ? [finish(d)] : u ? finish(d) : Promise.resolve(finish(d));
|
|
683
925
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
value: function revive(t, r) {
|
|
712
|
-
var n = t && t.$types;
|
|
713
|
-
if (!n) return t;
|
|
714
|
-
if (!0 === n) return t.$;
|
|
715
|
-
|
|
716
|
-
var a = (r = _objectSpread2(_objectSpread2({
|
|
717
|
-
sync: !0
|
|
718
|
-
}, this.options), r)).sync,
|
|
926
|
+
}, {
|
|
927
|
+
key: "encapsulateSync",
|
|
928
|
+
value: function encapsulateSync(e, t, r) {
|
|
929
|
+
return this.encapsulate(e, t, _objectSpread2(_objectSpread2({
|
|
930
|
+
throwOnBadSyncType: !0
|
|
931
|
+
}, r), {}, {
|
|
932
|
+
sync: !0
|
|
933
|
+
}));
|
|
934
|
+
}
|
|
935
|
+
}, {
|
|
936
|
+
key: "encapsulateAsync",
|
|
937
|
+
value: function encapsulateAsync(e, t, r) {
|
|
938
|
+
return this.encapsulate(e, t, _objectSpread2(_objectSpread2({
|
|
939
|
+
throwOnBadSyncType: !0
|
|
940
|
+
}, r), {}, {
|
|
941
|
+
sync: !1
|
|
942
|
+
}));
|
|
943
|
+
}
|
|
944
|
+
}, {
|
|
945
|
+
key: "revive",
|
|
946
|
+
value: function revive(t, r) {
|
|
947
|
+
var n = t && t.$types;
|
|
948
|
+
if (!n) return t;
|
|
949
|
+
if (!0 === n) return t.$;
|
|
950
|
+
var o = (r = _objectSpread2(_objectSpread2({
|
|
951
|
+
sync: !0
|
|
952
|
+
}, this.options), r)).sync,
|
|
719
953
|
c = [],
|
|
720
954
|
s = {},
|
|
721
955
|
u = !0;
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
function checkUndefined(e) {
|
|
736
|
-
return hasConstructorOf(e, p) ? void 0 : e;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
var f,
|
|
956
|
+
n.$ && isPlainObject(n.$) && (t = t.$, n = n.$, u = !1);
|
|
957
|
+
var l = this;
|
|
958
|
+
function executeReviver(e, t) {
|
|
959
|
+
var r = _slicedToArray(l.revivers[e] || [], 1)[0];
|
|
960
|
+
if (!r) throw new Error("Unregistered type: " + e);
|
|
961
|
+
return o && !("revive" in r) ? t : r[o && r.revive ? "revive" : !o && r.reviveAsync ? "reviveAsync" : "revive"](t, s);
|
|
962
|
+
}
|
|
963
|
+
var y = [];
|
|
964
|
+
function checkUndefined(e) {
|
|
965
|
+
return hasConstructorOf(e, p) ? void 0 : e;
|
|
966
|
+
}
|
|
967
|
+
var f,
|
|
740
968
|
h = function revivePlainObjects() {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
if (!u || "$types" !== t) {
|
|
776
|
-
var f = n[t],
|
|
969
|
+
var r = [];
|
|
970
|
+
if (Object.entries(n).forEach(function (e) {
|
|
971
|
+
var t = _slicedToArray(e, 2),
|
|
972
|
+
o = t[0],
|
|
973
|
+
a = t[1];
|
|
974
|
+
"#" !== a && [].concat(a).forEach(function (e) {
|
|
975
|
+
_slicedToArray(l.revivers[e] || [null, {}], 2)[1].plain && (r.push({
|
|
976
|
+
keypath: o,
|
|
977
|
+
type: e
|
|
978
|
+
}), delete n[o]);
|
|
979
|
+
});
|
|
980
|
+
}), r.length) return r.sort(nestedPathsFirst).reduce(function reducer(r, n) {
|
|
981
|
+
var o = n.keypath,
|
|
982
|
+
a = n.type;
|
|
983
|
+
if (isThenable(r)) return r.then(function (e) {
|
|
984
|
+
return reducer(e, {
|
|
985
|
+
keypath: o,
|
|
986
|
+
type: a
|
|
987
|
+
});
|
|
988
|
+
});
|
|
989
|
+
var i = getByKeyPath(t, o);
|
|
990
|
+
if (hasConstructorOf(i = executeReviver(a, i), e)) return i.then(function (e) {
|
|
991
|
+
var r = setAtKeyPath(t, o, e);
|
|
992
|
+
r === e && (t = r);
|
|
993
|
+
});
|
|
994
|
+
var c = setAtKeyPath(t, o, i);
|
|
995
|
+
c === i && (t = c);
|
|
996
|
+
}, void 0);
|
|
997
|
+
}();
|
|
998
|
+
return hasConstructorOf(h, e) ? f = h.then(function () {
|
|
999
|
+
return t;
|
|
1000
|
+
}) : (f = function _revive(t, r, o, s, l) {
|
|
1001
|
+
if (!u || "$types" !== t) {
|
|
1002
|
+
var f = n[t],
|
|
777
1003
|
h = i$1(r);
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
for (o(r).forEach(function (n) {
|
|
783
|
-
var o = _revive(t + (t ? "." : "") + escapeKeyPathComponent(n), r[n], a || v, v, n),
|
|
1004
|
+
if (h || isPlainObject(r)) {
|
|
1005
|
+
var v = h ? new Array(r.length) : {};
|
|
1006
|
+
for (a(r).forEach(function (n) {
|
|
1007
|
+
var a = _revive(t + (t ? "." : "") + escapeKeyPathComponent(n), r[n], o || v, v, n),
|
|
784
1008
|
i = function set(e) {
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
})
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
O[j] = m, c.splice(0, 1);
|
|
1009
|
+
return hasConstructorOf(e, p) ? v[n] = void 0 : void 0 !== e && (v[n] = e), e;
|
|
1010
|
+
};
|
|
1011
|
+
hasConstructorOf(a, e) ? y.push(a.then(function (e) {
|
|
1012
|
+
return i(e);
|
|
1013
|
+
})) : i(a);
|
|
1014
|
+
}), r = v; c.length;) {
|
|
1015
|
+
var b = _slicedToArray(c[0], 4),
|
|
1016
|
+
d = b[0],
|
|
1017
|
+
_ = b[1],
|
|
1018
|
+
O = b[2],
|
|
1019
|
+
j = b[3],
|
|
1020
|
+
m = getByKeyPath(d, _);
|
|
1021
|
+
if (void 0 === m) break;
|
|
1022
|
+
O[j] = m, c.splice(0, 1);
|
|
1023
|
+
}
|
|
801
1024
|
}
|
|
1025
|
+
if (!f) return r;
|
|
1026
|
+
if ("#" === f) {
|
|
1027
|
+
var g = getByKeyPath(o, r.slice(1));
|
|
1028
|
+
return void 0 === g && c.push([o, r.slice(1), s, l]), g;
|
|
1029
|
+
}
|
|
1030
|
+
return [].concat(f).reduce(function reducer(t, r) {
|
|
1031
|
+
return hasConstructorOf(t, e) ? t.then(function (e) {
|
|
1032
|
+
return reducer(e, r);
|
|
1033
|
+
}) : executeReviver(r, t);
|
|
1034
|
+
}, r);
|
|
802
1035
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
1036
|
+
}("", t, null), y.length && (f = e.resolve(f).then(function (t) {
|
|
1037
|
+
return e.all([t].concat(y));
|
|
1038
|
+
}).then(function (e) {
|
|
1039
|
+
return _slicedToArray(e, 1)[0];
|
|
1040
|
+
}))), isThenable(f) ? o && r.throwOnBadSyncType ? function () {
|
|
1041
|
+
throw new TypeError("Sync method requested but async result obtained");
|
|
1042
|
+
}() : hasConstructorOf(f, e) ? f.p.then(checkUndefined) : f : !o && r.throwOnBadSyncType ? function () {
|
|
1043
|
+
throw new TypeError("Async method requested but sync result obtained");
|
|
1044
|
+
}() : o ? checkUndefined(f) : Promise.resolve(checkUndefined(f));
|
|
1045
|
+
}
|
|
1046
|
+
}, {
|
|
1047
|
+
key: "reviveSync",
|
|
1048
|
+
value: function reviveSync(e, t) {
|
|
1049
|
+
return this.revive(e, _objectSpread2(_objectSpread2({
|
|
1050
|
+
throwOnBadSyncType: !0
|
|
1051
|
+
}, t), {}, {
|
|
1052
|
+
sync: !0
|
|
1053
|
+
}));
|
|
1054
|
+
}
|
|
1055
|
+
}, {
|
|
1056
|
+
key: "reviveAsync",
|
|
1057
|
+
value: function reviveAsync(e, t) {
|
|
1058
|
+
return this.revive(e, _objectSpread2(_objectSpread2({
|
|
1059
|
+
throwOnBadSyncType: !0
|
|
1060
|
+
}, t), {}, {
|
|
1061
|
+
sync: !1
|
|
1062
|
+
}));
|
|
1063
|
+
}
|
|
1064
|
+
}, {
|
|
1065
|
+
key: "register",
|
|
1066
|
+
value: function register(e, t) {
|
|
1067
|
+
var r = this;
|
|
1068
|
+
t = t || {};
|
|
1069
|
+
var n = function R(e) {
|
|
1070
|
+
i$1(e) ? e.forEach(function (e) {
|
|
1071
|
+
return R(e);
|
|
1072
|
+
}) : e && a(e).forEach(function (n) {
|
|
1073
|
+
if ("#" === n) throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");
|
|
1074
|
+
if (l.includes(n)) throw new TypeError("Plain JSON object types are reserved as type names");
|
|
1075
|
+
var o = e[n],
|
|
1076
|
+
a = o && o.testPlainObjects ? r.plainObjectReplacers : r.nonplainObjectReplacers,
|
|
1077
|
+
c = a.filter(function (e) {
|
|
1078
|
+
return e.type === n;
|
|
1079
|
+
});
|
|
1080
|
+
if (c.length && (a.splice(a.indexOf(c[0]), 1), delete r.revivers[n], delete r.types[n]), "function" == typeof o) {
|
|
1081
|
+
var s = o;
|
|
1082
|
+
o = {
|
|
1083
|
+
test: function test(e) {
|
|
1084
|
+
return e && e.constructor === s;
|
|
1085
|
+
},
|
|
1086
|
+
replace: function replace(e) {
|
|
1087
|
+
return _objectSpread2({}, e);
|
|
1088
|
+
},
|
|
1089
|
+
revive: function revive(e) {
|
|
1090
|
+
return Object.assign(Object.create(s.prototype), e);
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
} else if (i$1(o)) {
|
|
1094
|
+
var u = _slicedToArray(o, 3);
|
|
1095
|
+
o = {
|
|
1096
|
+
test: u[0],
|
|
1097
|
+
replace: u[1],
|
|
1098
|
+
revive: u[2]
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
if (o && o.test) {
|
|
1102
|
+
var p = {
|
|
1103
|
+
type: n,
|
|
1104
|
+
test: o.test.bind(o)
|
|
1105
|
+
};
|
|
1106
|
+
o.replace && (p.replace = o.replace.bind(o)), o.replaceAsync && (p.replaceAsync = o.replaceAsync.bind(o));
|
|
1107
|
+
var y = "number" == typeof t.fallback ? t.fallback : t.fallback ? 0 : Number.POSITIVE_INFINITY;
|
|
1108
|
+
if (o.testPlainObjects ? r.plainObjectReplacers.splice(y, 0, p) : r.nonplainObjectReplacers.splice(y, 0, p), o.revive || o.reviveAsync) {
|
|
1109
|
+
var f = {};
|
|
1110
|
+
o.revive && (f.revive = o.revive.bind(o)), o.reviveAsync && (f.reviveAsync = o.reviveAsync.bind(o)), r.revivers[n] = [f, {
|
|
1111
|
+
plain: o.testPlainObjects
|
|
1112
|
+
}];
|
|
874
1113
|
}
|
|
875
|
-
|
|
876
|
-
} else if (i$1(a)) {
|
|
877
|
-
var u = _slicedToArray(a, 3);
|
|
878
|
-
|
|
879
|
-
a = {
|
|
880
|
-
test: u[0],
|
|
881
|
-
replace: u[1],
|
|
882
|
-
revive: u[2]
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
if (a && a.test) {
|
|
887
|
-
var p = {
|
|
888
|
-
type: n,
|
|
889
|
-
test: a.test.bind(a)
|
|
890
|
-
};
|
|
891
|
-
a.replace && (p.replace = a.replace.bind(a)), a.replaceAsync && (p.replaceAsync = a.replaceAsync.bind(a));
|
|
892
|
-
var l = "number" == typeof t.fallback ? t.fallback : t.fallback ? 0 : Number.POSITIVE_INFINITY;
|
|
893
|
-
|
|
894
|
-
if (a.testPlainObjects ? r.plainObjectReplacers.splice(l, 0, p) : r.nonplainObjectReplacers.splice(l, 0, p), a.revive || a.reviveAsync) {
|
|
895
|
-
var f = {};
|
|
896
|
-
a.revive && (f.revive = a.revive.bind(a)), a.reviveAsync && (f.reviveAsync = a.reviveAsync.bind(a)), r.revivers[n] = [f, {
|
|
897
|
-
plain: a.testPlainObjects
|
|
898
|
-
}];
|
|
1114
|
+
r.types[n] = o;
|
|
899
1115
|
}
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
}
|
|
911
|
-
}(),
|
|
912
|
-
p = _createClass(function Undefined() {
|
|
913
|
-
_classCallCheck(this, Undefined);
|
|
914
|
-
});
|
|
915
|
-
|
|
1116
|
+
});
|
|
1117
|
+
};
|
|
1118
|
+
return [].concat(e).forEach(function (e) {
|
|
1119
|
+
return n(e);
|
|
1120
|
+
}), this;
|
|
1121
|
+
}
|
|
1122
|
+
}]), Typeson;
|
|
1123
|
+
}(),
|
|
1124
|
+
p = _createClass(function Undefined() {
|
|
1125
|
+
_classCallCheck(this, Undefined);
|
|
1126
|
+
});
|
|
916
1127
|
p.__typeson__type__ = "TypesonUndefined";
|
|
917
|
-
var
|
|
1128
|
+
var l = ["null", "boolean", "number", "string", "array", "object"];
|
|
918
1129
|
|
|
919
1130
|
/*
|
|
920
1131
|
* base64-arraybuffer
|
|
@@ -926,7 +1137,6 @@
|
|
|
926
1137
|
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; // Use a lookup table to find the index.
|
|
927
1138
|
|
|
928
1139
|
var lookup = new Uint8Array(256);
|
|
929
|
-
|
|
930
1140
|
for (var i = 0; i < chars.length; i++) {
|
|
931
1141
|
lookup[chars.codePointAt(i)] = i;
|
|
932
1142
|
}
|
|
@@ -937,30 +1147,27 @@
|
|
|
937
1147
|
* @returns {string}
|
|
938
1148
|
*/
|
|
939
1149
|
|
|
940
|
-
|
|
941
1150
|
var encode = function encode(arraybuffer, byteOffset, lngth) {
|
|
942
1151
|
if (lngth === null || lngth === undefined) {
|
|
943
1152
|
lngth = arraybuffer.byteLength; // Needed for Safari
|
|
944
1153
|
}
|
|
945
1154
|
|
|
946
|
-
var bytes = new Uint8Array(arraybuffer, byteOffset || 0,
|
|
1155
|
+
var bytes = new Uint8Array(arraybuffer, byteOffset || 0,
|
|
1156
|
+
// Default needed for Safari
|
|
947
1157
|
lngth);
|
|
948
1158
|
var len = bytes.length;
|
|
949
1159
|
var base64 = '';
|
|
950
|
-
|
|
951
1160
|
for (var _i = 0; _i < len; _i += 3) {
|
|
952
1161
|
base64 += chars[bytes[_i] >> 2];
|
|
953
1162
|
base64 += chars[(bytes[_i] & 3) << 4 | bytes[_i + 1] >> 4];
|
|
954
1163
|
base64 += chars[(bytes[_i + 1] & 15) << 2 | bytes[_i + 2] >> 6];
|
|
955
1164
|
base64 += chars[bytes[_i + 2] & 63];
|
|
956
1165
|
}
|
|
957
|
-
|
|
958
1166
|
if (len % 3 === 2) {
|
|
959
1167
|
base64 = base64.slice(0, -1) + '=';
|
|
960
1168
|
} else if (len % 3 === 1) {
|
|
961
1169
|
base64 = base64.slice(0, -2) + '==';
|
|
962
1170
|
}
|
|
963
|
-
|
|
964
1171
|
return base64;
|
|
965
1172
|
};
|
|
966
1173
|
/**
|
|
@@ -968,24 +1175,19 @@
|
|
|
968
1175
|
* @returns {ArrayBuffer}
|
|
969
1176
|
*/
|
|
970
1177
|
|
|
971
|
-
|
|
972
1178
|
var decode = function decode(base64) {
|
|
973
1179
|
var len = base64.length;
|
|
974
1180
|
var bufferLength = base64.length * 0.75;
|
|
975
1181
|
var p = 0;
|
|
976
1182
|
var encoded1, encoded2, encoded3, encoded4;
|
|
977
|
-
|
|
978
1183
|
if (base64[base64.length - 1] === '=') {
|
|
979
1184
|
bufferLength--;
|
|
980
|
-
|
|
981
1185
|
if (base64[base64.length - 2] === '=') {
|
|
982
1186
|
bufferLength--;
|
|
983
1187
|
}
|
|
984
1188
|
}
|
|
985
|
-
|
|
986
1189
|
var arraybuffer = new ArrayBuffer(bufferLength),
|
|
987
|
-
|
|
988
|
-
|
|
1190
|
+
bytes = new Uint8Array(arraybuffer);
|
|
989
1191
|
for (var _i2 = 0; _i2 < len; _i2 += 4) {
|
|
990
1192
|
encoded1 = lookup[base64.codePointAt(_i2)];
|
|
991
1193
|
encoded2 = lookup[base64.codePointAt(_i2 + 1)];
|
|
@@ -995,7 +1197,6 @@
|
|
|
995
1197
|
bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
|
|
996
1198
|
bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
|
|
997
1199
|
}
|
|
998
|
-
|
|
999
1200
|
return arraybuffer;
|
|
1000
1201
|
};
|
|
1001
1202
|
|
|
@@ -1008,15 +1209,12 @@
|
|
|
1008
1209
|
if (!stateObj.buffers) {
|
|
1009
1210
|
stateObj.buffers = [];
|
|
1010
1211
|
}
|
|
1011
|
-
|
|
1012
1212
|
var index = stateObj.buffers.indexOf(b);
|
|
1013
|
-
|
|
1014
1213
|
if (index > -1) {
|
|
1015
1214
|
return {
|
|
1016
1215
|
index: index
|
|
1017
1216
|
};
|
|
1018
1217
|
}
|
|
1019
|
-
|
|
1020
1218
|
stateObj.buffers.push(b);
|
|
1021
1219
|
return encode(b);
|
|
1022
1220
|
},
|
|
@@ -1024,18 +1222,17 @@
|
|
|
1024
1222
|
if (!stateObj.buffers) {
|
|
1025
1223
|
stateObj.buffers = [];
|
|
1026
1224
|
}
|
|
1027
|
-
|
|
1028
1225
|
if (_typeof$1(b64) === 'object') {
|
|
1029
1226
|
return stateObj.buffers[b64.index];
|
|
1030
1227
|
}
|
|
1031
|
-
|
|
1032
1228
|
var buffer = decode(b64);
|
|
1033
1229
|
stateObj.buffers.push(buffer);
|
|
1034
1230
|
return buffer;
|
|
1035
1231
|
}
|
|
1036
1232
|
}
|
|
1037
1233
|
};
|
|
1038
|
-
|
|
1234
|
+
|
|
1235
|
+
// See also typed-arrays!
|
|
1039
1236
|
|
|
1040
1237
|
var bigintObject = {
|
|
1041
1238
|
bigintObject: {
|
|
@@ -1052,6 +1249,7 @@
|
|
|
1052
1249
|
};
|
|
1053
1250
|
|
|
1054
1251
|
/* globals BigInt */
|
|
1252
|
+
|
|
1055
1253
|
var bigint = {
|
|
1056
1254
|
bigint: {
|
|
1057
1255
|
test: function test(x) {
|
|
@@ -1067,13 +1265,12 @@
|
|
|
1067
1265
|
* @param {ArrayBuffer} buf
|
|
1068
1266
|
* @returns {Uint8Array}
|
|
1069
1267
|
*/
|
|
1268
|
+
|
|
1070
1269
|
/**
|
|
1071
1270
|
*
|
|
1072
1271
|
* @param {string} str
|
|
1073
1272
|
* @returns {ArrayBuffer}
|
|
1074
1273
|
*/
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
1274
|
function string2arraybuffer(str) {
|
|
1078
1275
|
/*
|
|
1079
1276
|
// UTF-8 approaches
|
|
@@ -1110,7 +1307,6 @@
|
|
|
1110
1307
|
}
|
|
1111
1308
|
return utf8;
|
|
1112
1309
|
*/
|
|
1113
|
-
|
|
1114
1310
|
/*
|
|
1115
1311
|
// Working UTF-16 options (equivalents)
|
|
1116
1312
|
const buf = new ArrayBuffer(str.length * 2); // 2 bytes for each char
|
|
@@ -1120,8 +1316,8 @@
|
|
|
1120
1316
|
}
|
|
1121
1317
|
return buf;
|
|
1122
1318
|
*/
|
|
1123
|
-
var array = new Uint8Array(str.length);
|
|
1124
1319
|
|
|
1320
|
+
var array = new Uint8Array(str.length);
|
|
1125
1321
|
for (var i = 0; i < str.length; i++) {
|
|
1126
1322
|
// eslint-disable-next-line max-len -- Long
|
|
1127
1323
|
// eslint-disable-next-line unicorn/prefer-code-point -- Iterating char. codes
|
|
@@ -1142,15 +1338,13 @@
|
|
|
1142
1338
|
var req = new XMLHttpRequest();
|
|
1143
1339
|
req.overrideMimeType('text/plain; charset=x-user-defined');
|
|
1144
1340
|
req.open('GET', URL.createObjectURL(b), false); // Sync
|
|
1341
|
+
req.send();
|
|
1145
1342
|
|
|
1146
|
-
|
|
1147
|
-
|
|
1343
|
+
// Seems not feasible to accurately simulate
|
|
1148
1344
|
/* c8 ignore next 3 */
|
|
1149
|
-
|
|
1150
1345
|
if (req.status !== 200 && req.status !== 0) {
|
|
1151
1346
|
throw new Error('Bad Blob access: ' + req.status);
|
|
1152
1347
|
}
|
|
1153
|
-
|
|
1154
1348
|
return {
|
|
1155
1349
|
type: b.type,
|
|
1156
1350
|
stringContents: req.responseText
|
|
@@ -1158,7 +1352,7 @@
|
|
|
1158
1352
|
},
|
|
1159
1353
|
revive: function revive(_ref) {
|
|
1160
1354
|
var type = _ref.type,
|
|
1161
|
-
|
|
1355
|
+
stringContents = _ref.stringContents;
|
|
1162
1356
|
return new Blob([string2arraybuffer(stringContents)], {
|
|
1163
1357
|
type: type
|
|
1164
1358
|
});
|
|
@@ -1177,10 +1371,9 @@
|
|
|
1177
1371
|
type: b.type,
|
|
1178
1372
|
stringContents: reader.result
|
|
1179
1373
|
});
|
|
1180
|
-
});
|
|
1181
|
-
|
|
1374
|
+
});
|
|
1375
|
+
// Seems not feasible to accurately simulate
|
|
1182
1376
|
/* c8 ignore next 3 */
|
|
1183
|
-
|
|
1184
1377
|
reader.addEventListener('error', function () {
|
|
1185
1378
|
reject(reader.error);
|
|
1186
1379
|
});
|
|
@@ -1191,6 +1384,7 @@
|
|
|
1191
1384
|
};
|
|
1192
1385
|
|
|
1193
1386
|
/* globals performance */
|
|
1387
|
+
|
|
1194
1388
|
// The `performance` global is optional
|
|
1195
1389
|
|
|
1196
1390
|
/**
|
|
@@ -1202,10 +1396,9 @@
|
|
|
1202
1396
|
*/
|
|
1203
1397
|
function generateUUID() {
|
|
1204
1398
|
// Adapted from original: public domain/MIT: http://stackoverflow.com/a/8809472/271577
|
|
1205
|
-
|
|
1206
1399
|
/* c8 ignore next */
|
|
1207
|
-
var d = Date.now() + (
|
|
1208
|
-
|
|
1400
|
+
var d = Date.now() + (
|
|
1401
|
+
// use high-precision timer if available
|
|
1209
1402
|
/* c8 ignore next 4 */
|
|
1210
1403
|
typeof performance !== 'undefined' && typeof performance.now === 'function' ? performance.now() : 0);
|
|
1211
1404
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
@@ -1234,7 +1427,7 @@
|
|
|
1234
1427
|
},
|
|
1235
1428
|
revive: function revive(_ref) {
|
|
1236
1429
|
var uuid = _ref.uuid,
|
|
1237
|
-
|
|
1430
|
+
encapsulated = _ref.encapsulated;
|
|
1238
1431
|
return cloneableObjectsByUUID[uuid][Symbol["for"]('cloneRevive')](encapsulated);
|
|
1239
1432
|
}
|
|
1240
1433
|
}
|
|
@@ -1247,42 +1440,35 @@
|
|
|
1247
1440
|
},
|
|
1248
1441
|
replaceAsync: function replaceAsync(key) {
|
|
1249
1442
|
return new e( /*#__PURE__*/function () {
|
|
1250
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/
|
|
1443
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {
|
|
1251
1444
|
var jwk;
|
|
1252
|
-
return
|
|
1253
|
-
while (1) {
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
});
|
|
1277
|
-
|
|
1278
|
-
case 11:
|
|
1279
|
-
case "end":
|
|
1280
|
-
return _context.stop();
|
|
1281
|
-
}
|
|
1445
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1446
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1447
|
+
case 0:
|
|
1448
|
+
_context.prev = 0;
|
|
1449
|
+
_context.next = 3;
|
|
1450
|
+
return crypto.subtle.exportKey('jwk', key);
|
|
1451
|
+
case 3:
|
|
1452
|
+
jwk = _context.sent;
|
|
1453
|
+
_context.next = 10;
|
|
1454
|
+
break;
|
|
1455
|
+
case 6:
|
|
1456
|
+
_context.prev = 6;
|
|
1457
|
+
_context.t0 = _context["catch"](0);
|
|
1458
|
+
reject(_context.t0);
|
|
1459
|
+
return _context.abrupt("return");
|
|
1460
|
+
case 10:
|
|
1461
|
+
resolve({
|
|
1462
|
+
jwk: jwk,
|
|
1463
|
+
algorithm: key.algorithm,
|
|
1464
|
+
usages: key.usages
|
|
1465
|
+
});
|
|
1466
|
+
case 11:
|
|
1467
|
+
case "end":
|
|
1468
|
+
return _context.stop();
|
|
1282
1469
|
}
|
|
1283
1470
|
}, _callee, null, [[0, 6]]);
|
|
1284
1471
|
}));
|
|
1285
|
-
|
|
1286
1472
|
return function (_x, _x2) {
|
|
1287
1473
|
return _ref.apply(this, arguments);
|
|
1288
1474
|
};
|
|
@@ -1290,8 +1476,8 @@
|
|
|
1290
1476
|
},
|
|
1291
1477
|
revive: function revive(_ref2) {
|
|
1292
1478
|
var jwk = _ref2.jwk,
|
|
1293
|
-
|
|
1294
|
-
|
|
1479
|
+
algorithm = _ref2.algorithm,
|
|
1480
|
+
usages = _ref2.usages;
|
|
1295
1481
|
return crypto.subtle.importKey('jwk', jwk, algorithm, true, usages);
|
|
1296
1482
|
}
|
|
1297
1483
|
}
|
|
@@ -1304,15 +1490,12 @@
|
|
|
1304
1490
|
},
|
|
1305
1491
|
replace: function replace(_ref, stateObj) {
|
|
1306
1492
|
var buffer = _ref.buffer,
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1493
|
+
byteOffset = _ref.byteOffset,
|
|
1494
|
+
byteLength = _ref.byteLength;
|
|
1310
1495
|
if (!stateObj.buffers) {
|
|
1311
1496
|
stateObj.buffers = [];
|
|
1312
1497
|
}
|
|
1313
|
-
|
|
1314
1498
|
var index = stateObj.buffers.indexOf(buffer);
|
|
1315
|
-
|
|
1316
1499
|
if (index > -1) {
|
|
1317
1500
|
return {
|
|
1318
1501
|
index: index,
|
|
@@ -1320,7 +1503,6 @@
|
|
|
1320
1503
|
byteLength: byteLength
|
|
1321
1504
|
};
|
|
1322
1505
|
}
|
|
1323
|
-
|
|
1324
1506
|
stateObj.buffers.push(buffer);
|
|
1325
1507
|
return {
|
|
1326
1508
|
encoded: encode(buffer),
|
|
@@ -1332,20 +1514,17 @@
|
|
|
1332
1514
|
if (!stateObj.buffers) {
|
|
1333
1515
|
stateObj.buffers = [];
|
|
1334
1516
|
}
|
|
1335
|
-
|
|
1336
1517
|
var byteOffset = b64Obj.byteOffset,
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1518
|
+
byteLength = b64Obj.byteLength,
|
|
1519
|
+
encoded = b64Obj.encoded,
|
|
1520
|
+
index = b64Obj.index;
|
|
1340
1521
|
var buffer;
|
|
1341
|
-
|
|
1342
1522
|
if ('index' in b64Obj) {
|
|
1343
1523
|
buffer = stateObj.buffers[index];
|
|
1344
1524
|
} else {
|
|
1345
1525
|
buffer = decode(encoded);
|
|
1346
1526
|
stateObj.buffers.push(buffer);
|
|
1347
1527
|
}
|
|
1348
|
-
|
|
1349
1528
|
return new DataView(buffer, byteOffset, byteLength);
|
|
1350
1529
|
}
|
|
1351
1530
|
}
|
|
@@ -1358,18 +1537,15 @@
|
|
|
1358
1537
|
},
|
|
1359
1538
|
replace: function replace(dt) {
|
|
1360
1539
|
var time = dt.getTime();
|
|
1361
|
-
|
|
1362
1540
|
if (Number.isNaN(time)) {
|
|
1363
1541
|
return 'NaN';
|
|
1364
1542
|
}
|
|
1365
|
-
|
|
1366
1543
|
return time;
|
|
1367
1544
|
},
|
|
1368
1545
|
revive: function revive(time) {
|
|
1369
1546
|
if (time === 'NaN') {
|
|
1370
1547
|
return new Date(Number.NaN);
|
|
1371
1548
|
}
|
|
1372
|
-
|
|
1373
1549
|
return new Date(time);
|
|
1374
1550
|
}
|
|
1375
1551
|
}
|
|
@@ -1382,51 +1558,93 @@
|
|
|
1382
1558
|
},
|
|
1383
1559
|
replace: function replace(_ref) {
|
|
1384
1560
|
var name = _ref.name,
|
|
1385
|
-
|
|
1561
|
+
message = _ref.message,
|
|
1562
|
+
cause = _ref.cause,
|
|
1563
|
+
stack = _ref.stack,
|
|
1564
|
+
fileName = _ref.fileName,
|
|
1565
|
+
lineNumber = _ref.lineNumber,
|
|
1566
|
+
columnNumber = _ref.columnNumber;
|
|
1386
1567
|
return {
|
|
1387
1568
|
name: name,
|
|
1388
|
-
message: message
|
|
1569
|
+
message: message,
|
|
1570
|
+
cause: cause,
|
|
1571
|
+
stack: stack,
|
|
1572
|
+
fileName: fileName,
|
|
1573
|
+
lineNumber: lineNumber,
|
|
1574
|
+
columnNumber: columnNumber
|
|
1389
1575
|
};
|
|
1390
1576
|
},
|
|
1391
|
-
revive: function revive(
|
|
1392
|
-
var
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1577
|
+
revive: function revive(obj) {
|
|
1578
|
+
var e = new Error(obj.message);
|
|
1579
|
+
['name', 'cause', 'stack', 'fileName', 'lineNumber', 'columnNumber'].forEach(function (prop) {
|
|
1580
|
+
e[prop] = obj[prop];
|
|
1581
|
+
});
|
|
1396
1582
|
return e;
|
|
1397
1583
|
}
|
|
1398
1584
|
}
|
|
1399
|
-
};
|
|
1585
|
+
};
|
|
1400
1586
|
|
|
1401
1587
|
/* globals InternalError */
|
|
1402
|
-
var errors = {};
|
|
1588
|
+
var errors = {};
|
|
1403
1589
|
|
|
1590
|
+
// JS standard
|
|
1404
1591
|
[TypeError, RangeError, SyntaxError, ReferenceError, EvalError, URIError].forEach(function (error) {
|
|
1405
1592
|
return create$2(error);
|
|
1406
1593
|
});
|
|
1594
|
+
|
|
1595
|
+
/* c8 ignore next 3 */
|
|
1596
|
+
if (typeof AggregateError !== 'undefined') {
|
|
1597
|
+
create$2(AggregateError);
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1407
1600
|
/* c8 ignore next 2 */
|
|
1408
1601
|
// @ts-ignore Non-standard
|
|
1409
|
-
|
|
1410
1602
|
typeof InternalError === 'function' && create$2(InternalError);
|
|
1603
|
+
|
|
1411
1604
|
/**
|
|
1412
1605
|
* Comprises all built-in errors.
|
|
1413
1606
|
* @param {
|
|
1414
1607
|
* TypeError|RangeError|SyntaxError|ReferenceError|EvalError|URIError|
|
|
1415
|
-
* InternalError
|
|
1608
|
+
* AggregateError|InternalError
|
|
1416
1609
|
* } Ctor
|
|
1417
1610
|
* @returns {void}
|
|
1418
1611
|
*/
|
|
1419
|
-
|
|
1420
1612
|
function create$2(Ctor) {
|
|
1421
1613
|
errors[Ctor.name.toLowerCase()] = {
|
|
1422
1614
|
test: function test(x) {
|
|
1423
1615
|
return hasConstructorOf(x, Ctor);
|
|
1424
1616
|
},
|
|
1425
|
-
replace: function replace(
|
|
1426
|
-
|
|
1617
|
+
replace: function replace(_ref) {
|
|
1618
|
+
var name = _ref.name,
|
|
1619
|
+
message = _ref.message,
|
|
1620
|
+
cause = _ref.cause,
|
|
1621
|
+
stack = _ref.stack,
|
|
1622
|
+
fileName = _ref.fileName,
|
|
1623
|
+
lineNumber = _ref.lineNumber,
|
|
1624
|
+
columnNumber = _ref.columnNumber,
|
|
1625
|
+
errs = _ref.errors;
|
|
1626
|
+
return {
|
|
1627
|
+
name: name,
|
|
1628
|
+
message: message,
|
|
1629
|
+
cause: cause,
|
|
1630
|
+
stack: stack,
|
|
1631
|
+
fileName: fileName,
|
|
1632
|
+
lineNumber: lineNumber,
|
|
1633
|
+
columnNumber: columnNumber,
|
|
1634
|
+
errors: errs
|
|
1635
|
+
};
|
|
1427
1636
|
},
|
|
1428
|
-
revive: function revive(
|
|
1429
|
-
|
|
1637
|
+
revive: function revive(obj) {
|
|
1638
|
+
var isAggregateError = typeof AggregateError !== 'undefined' && Ctor === AggregateError;
|
|
1639
|
+
var e = isAggregateError ? new Ctor(obj.errors, obj.message) : new Ctor(obj.message);
|
|
1640
|
+
['name', 'cause', 'stack', 'fileName', 'lineNumber', 'columnNumber'].forEach(function (prop) {
|
|
1641
|
+
e[prop] = obj[prop];
|
|
1642
|
+
});
|
|
1643
|
+
/* c8 ignore next 6 */
|
|
1644
|
+
if (isAggregateError) {
|
|
1645
|
+
e.errors = obj.errors;
|
|
1646
|
+
}
|
|
1647
|
+
return e;
|
|
1430
1648
|
}
|
|
1431
1649
|
};
|
|
1432
1650
|
}
|
|
@@ -1442,15 +1660,13 @@
|
|
|
1442
1660
|
var req = new XMLHttpRequest();
|
|
1443
1661
|
req.overrideMimeType('text/plain; charset=x-user-defined');
|
|
1444
1662
|
req.open('GET', URL.createObjectURL(f), false); // Sync
|
|
1663
|
+
req.send();
|
|
1445
1664
|
|
|
1446
|
-
|
|
1447
|
-
|
|
1665
|
+
// Seems not feasible to accurately simulate
|
|
1448
1666
|
/* c8 ignore next 3 */
|
|
1449
|
-
|
|
1450
1667
|
if (req.status !== 200 && req.status !== 0) {
|
|
1451
1668
|
throw new Error('Bad File access: ' + req.status);
|
|
1452
1669
|
}
|
|
1453
|
-
|
|
1454
1670
|
return {
|
|
1455
1671
|
type: f.type,
|
|
1456
1672
|
stringContents: req.responseText,
|
|
@@ -1460,9 +1676,9 @@
|
|
|
1460
1676
|
},
|
|
1461
1677
|
revive: function revive(_ref) {
|
|
1462
1678
|
var name = _ref.name,
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1679
|
+
type = _ref.type,
|
|
1680
|
+
stringContents = _ref.stringContents,
|
|
1681
|
+
lastModified = _ref.lastModified;
|
|
1466
1682
|
return new File([string2arraybuffer(stringContents)], name, {
|
|
1467
1683
|
type: type,
|
|
1468
1684
|
lastModified: lastModified
|
|
@@ -1484,10 +1700,9 @@
|
|
|
1484
1700
|
name: f.name,
|
|
1485
1701
|
lastModified: f.lastModified
|
|
1486
1702
|
});
|
|
1487
|
-
});
|
|
1488
|
-
|
|
1703
|
+
});
|
|
1704
|
+
// Seems not feasible to accurately simulate
|
|
1489
1705
|
/* c8 ignore next 3 */
|
|
1490
|
-
|
|
1491
1706
|
reader.addEventListener('error', function () {
|
|
1492
1707
|
reject(reader.error);
|
|
1493
1708
|
});
|
|
@@ -1505,11 +1720,9 @@
|
|
|
1505
1720
|
},
|
|
1506
1721
|
replace: function replace(fl) {
|
|
1507
1722
|
var arr = [];
|
|
1508
|
-
|
|
1509
1723
|
for (var i = 0; i < fl.length; i++) {
|
|
1510
1724
|
arr[i] = fl.item(i);
|
|
1511
1725
|
}
|
|
1512
|
-
|
|
1513
1726
|
return arr;
|
|
1514
1727
|
},
|
|
1515
1728
|
revive: function revive(o) {
|
|
@@ -1522,7 +1735,6 @@
|
|
|
1522
1735
|
*/
|
|
1523
1736
|
function FileList() {
|
|
1524
1737
|
_classCallCheck$1(this, FileList);
|
|
1525
|
-
|
|
1526
1738
|
// eslint-disable-next-line prefer-rest-params
|
|
1527
1739
|
this._files = arguments[0];
|
|
1528
1740
|
this.length = this._files.length;
|
|
@@ -1531,19 +1743,15 @@
|
|
|
1531
1743
|
* @param {Integer} index
|
|
1532
1744
|
* @returns {File}
|
|
1533
1745
|
*/
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
1746
|
_createClass$1(FileList, [{
|
|
1537
1747
|
key: "item",
|
|
1538
1748
|
value: function item(index) {
|
|
1539
1749
|
return this._files[index];
|
|
1540
1750
|
}
|
|
1541
1751
|
/* eslint-disable class-methods-use-this */
|
|
1542
|
-
|
|
1543
1752
|
/**
|
|
1544
1753
|
* @returns {"FileList"}
|
|
1545
1754
|
*/
|
|
1546
|
-
|
|
1547
1755
|
}, {
|
|
1548
1756
|
key: _Symbol$toStringTag,
|
|
1549
1757
|
get: function get() {
|
|
@@ -1551,10 +1759,8 @@
|
|
|
1551
1759
|
return 'FileList';
|
|
1552
1760
|
}
|
|
1553
1761
|
}]);
|
|
1554
|
-
|
|
1555
1762
|
return FileList;
|
|
1556
1763
|
}(Symbol.toStringTag);
|
|
1557
|
-
|
|
1558
1764
|
return new FileList(o);
|
|
1559
1765
|
}
|
|
1560
1766
|
}
|
|
@@ -1564,20 +1770,21 @@
|
|
|
1564
1770
|
var imagebitmap = {
|
|
1565
1771
|
imagebitmap: {
|
|
1566
1772
|
test: function test(x) {
|
|
1567
|
-
return toStringTag(x) === 'ImageBitmap' ||
|
|
1773
|
+
return toStringTag(x) === 'ImageBitmap' ||
|
|
1774
|
+
// In Node, our polyfill sets the dataset on a canvas
|
|
1568
1775
|
// element as JSDom no longer allows overriding toStringTag
|
|
1569
1776
|
x && x.dataset && x.dataset.toStringTag === 'ImageBitmap';
|
|
1570
1777
|
},
|
|
1571
1778
|
replace: function replace(bm) {
|
|
1572
1779
|
var canvas = document.createElement('canvas');
|
|
1573
1780
|
var ctx = canvas.getContext('2d');
|
|
1574
|
-
ctx.drawImage(bm, 0, 0);
|
|
1781
|
+
ctx.drawImage(bm, 0, 0);
|
|
1782
|
+
// Although `width` and `height` are part of `ImageBitMap`,
|
|
1575
1783
|
// these will be auto-created for us when reviving with the
|
|
1576
1784
|
// data URL (and they are not settable even if they weren't)
|
|
1577
1785
|
// return {
|
|
1578
1786
|
// width: bm.width, height: bm.height, dataURL: canvas.toDataURL()
|
|
1579
1787
|
// };
|
|
1580
|
-
|
|
1581
1788
|
return canvas.toDataURL();
|
|
1582
1789
|
},
|
|
1583
1790
|
revive: function revive(o) {
|
|
@@ -1592,26 +1799,25 @@
|
|
|
1592
1799
|
*/
|
|
1593
1800
|
var canvas = document.createElement('canvas');
|
|
1594
1801
|
var ctx = canvas.getContext('2d');
|
|
1595
|
-
var img = document.createElement('img');
|
|
1596
|
-
|
|
1802
|
+
var img = document.createElement('img');
|
|
1803
|
+
// The onload is needed by some browsers per http://stackoverflow.com/a/4776378/271577
|
|
1597
1804
|
img.addEventListener('load', function () {
|
|
1598
1805
|
ctx.drawImage(img, 0, 0);
|
|
1599
1806
|
});
|
|
1600
|
-
img.src = o;
|
|
1807
|
+
img.src = o;
|
|
1808
|
+
// Works in contexts allowing an `ImageBitmap` (We might use
|
|
1601
1809
|
// `OffscreenCanvas.transferToBitmap` when supported)
|
|
1602
|
-
|
|
1603
1810
|
return canvas;
|
|
1604
1811
|
},
|
|
1605
1812
|
reviveAsync: function reviveAsync(o) {
|
|
1606
1813
|
var canvas = document.createElement('canvas');
|
|
1607
1814
|
var ctx = canvas.getContext('2d');
|
|
1608
|
-
var img = document.createElement('img');
|
|
1609
|
-
|
|
1815
|
+
var img = document.createElement('img');
|
|
1816
|
+
// The onload is needed by some browsers per http://stackoverflow.com/a/4776378/271577
|
|
1610
1817
|
img.addEventListener('load', function () {
|
|
1611
1818
|
ctx.drawImage(img, 0, 0);
|
|
1612
1819
|
});
|
|
1613
1820
|
img.src = o; // o.dataURL;
|
|
1614
|
-
|
|
1615
1821
|
return createImageBitmap(canvas); // Returns a promise
|
|
1616
1822
|
}
|
|
1617
1823
|
}
|
|
@@ -1734,12 +1940,14 @@
|
|
|
1734
1940
|
var nonbuiltinIgnore = {
|
|
1735
1941
|
nonbuiltinIgnore: {
|
|
1736
1942
|
test: function test(x) {
|
|
1737
|
-
return x && _typeof$1(x) === 'object' && !Array.isArray(x) && !['Object',
|
|
1943
|
+
return x && _typeof$1(x) === 'object' && !Array.isArray(x) && !['Object',
|
|
1944
|
+
// `Proxy` and `Reflect`, two other built-in objects, will also
|
|
1738
1945
|
// have a `toStringTag` of `Object`; we don't want built-in
|
|
1739
1946
|
// function objects, however
|
|
1740
1947
|
'Boolean', 'Number', 'String', 'Error', 'RegExp', 'Math', 'Date', 'Map', 'Set', 'JSON', 'ArrayBuffer', 'SharedArrayBuffer', 'DataView', 'Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array', 'Promise', 'String Iterator', 'Array Iterator', 'Map Iterator', 'Set Iterator', 'WeakMap', 'WeakSet', 'Atomics', 'Module'].includes(toStringTag(x));
|
|
1741
1948
|
},
|
|
1742
|
-
replace: function replace(rexp) {
|
|
1949
|
+
replace: function replace(rexp) {
|
|
1950
|
+
// Not in use
|
|
1743
1951
|
}
|
|
1744
1952
|
}
|
|
1745
1953
|
};
|
|
@@ -1755,7 +1963,6 @@
|
|
|
1755
1963
|
revive: function revive(s) {
|
|
1756
1964
|
return new String(s);
|
|
1757
1965
|
} // Revive to an objectified string
|
|
1758
|
-
|
|
1759
1966
|
},
|
|
1760
1967
|
// Boolean Object (not primitive boolean which need no type spec)
|
|
1761
1968
|
BooleanObject: {
|
|
@@ -1779,7 +1986,6 @@
|
|
|
1779
1986
|
revive: function revive(n) {
|
|
1780
1987
|
return new Number(n);
|
|
1781
1988
|
} // Revive to an objectified number
|
|
1782
|
-
|
|
1783
1989
|
}
|
|
1784
1990
|
};
|
|
1785
1991
|
|
|
@@ -1796,7 +2002,7 @@
|
|
|
1796
2002
|
},
|
|
1797
2003
|
revive: function revive(_ref) {
|
|
1798
2004
|
var source = _ref.source,
|
|
1799
|
-
|
|
2005
|
+
flags = _ref.flags;
|
|
1800
2006
|
return new RegExp(source, flags);
|
|
1801
2007
|
}
|
|
1802
2008
|
}
|
|
@@ -1835,7 +2041,9 @@
|
|
|
1835
2041
|
|
|
1836
2042
|
/* eslint-env browser, node */
|
|
1837
2043
|
|
|
2044
|
+
// Support all kinds of typed arrays (views of ArrayBuffers)
|
|
1838
2045
|
var typedArraysSocketIO = {};
|
|
2046
|
+
|
|
1839
2047
|
/**
|
|
1840
2048
|
* @param {
|
|
1841
2049
|
* Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|
|
|
@@ -1843,7 +2051,6 @@
|
|
|
1843
2051
|
* } TypedArray
|
|
1844
2052
|
* @returns {void}
|
|
1845
2053
|
*/
|
|
1846
|
-
|
|
1847
2054
|
function create$1(TypedArray) {
|
|
1848
2055
|
var typeName = TypedArray.name;
|
|
1849
2056
|
typedArraysSocketIO[typeName.toLowerCase()] = {
|
|
@@ -1851,7 +2058,8 @@
|
|
|
1851
2058
|
return toStringTag(x) === typeName;
|
|
1852
2059
|
},
|
|
1853
2060
|
replace: function replace(a) {
|
|
1854
|
-
return (a.byteOffset === 0 && a.byteLength === a.buffer.byteLength ? a
|
|
2061
|
+
return (a.byteOffset === 0 && a.byteLength === a.buffer.byteLength ? a
|
|
2062
|
+
// socket.io supports streaming ArrayBuffers.
|
|
1855
2063
|
// If we have a typed array representing a portion
|
|
1856
2064
|
// of the buffer, we need to clone
|
|
1857
2065
|
// the buffer before leaving it to socket.io.
|
|
@@ -1868,10 +2076,10 @@
|
|
|
1868
2076
|
}
|
|
1869
2077
|
};
|
|
1870
2078
|
}
|
|
1871
|
-
|
|
1872
2079
|
if (typeof Int8Array === 'function') {
|
|
1873
2080
|
// Those constructors are added in ES6 as a group.
|
|
1874
2081
|
// If we have Int8Array, we can assume the rest also exists.
|
|
2082
|
+
|
|
1875
2083
|
[Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].forEach(function (TypedArray) {
|
|
1876
2084
|
return create$1(TypedArray);
|
|
1877
2085
|
});
|
|
@@ -1879,6 +2087,7 @@
|
|
|
1879
2087
|
|
|
1880
2088
|
/* eslint-env browser, node */
|
|
1881
2089
|
var typedArrays = {};
|
|
2090
|
+
|
|
1882
2091
|
/**
|
|
1883
2092
|
* @param {
|
|
1884
2093
|
* Int8Array|Uint8Array|Uint8ClampedArray|Int16Array|Uint16Array|Int32Array|
|
|
@@ -1886,7 +2095,6 @@
|
|
|
1886
2095
|
* } TypedArray
|
|
1887
2096
|
* @returns {void}
|
|
1888
2097
|
*/
|
|
1889
|
-
|
|
1890
2098
|
function create(TypedArray) {
|
|
1891
2099
|
var typeName = TypedArray.name;
|
|
1892
2100
|
typedArrays[typeName.toLowerCase()] = {
|
|
@@ -1895,15 +2103,12 @@
|
|
|
1895
2103
|
},
|
|
1896
2104
|
replace: function replace(_ref, stateObj) {
|
|
1897
2105
|
var buffer = _ref.buffer,
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
2106
|
+
byteOffset = _ref.byteOffset,
|
|
2107
|
+
l = _ref.length;
|
|
1901
2108
|
if (!stateObj.buffers) {
|
|
1902
2109
|
stateObj.buffers = [];
|
|
1903
2110
|
}
|
|
1904
|
-
|
|
1905
2111
|
var index = stateObj.buffers.indexOf(buffer);
|
|
1906
|
-
|
|
1907
2112
|
if (index > -1) {
|
|
1908
2113
|
return {
|
|
1909
2114
|
index: index,
|
|
@@ -1911,7 +2116,6 @@
|
|
|
1911
2116
|
length: l
|
|
1912
2117
|
};
|
|
1913
2118
|
}
|
|
1914
|
-
|
|
1915
2119
|
stateObj.buffers.push(buffer);
|
|
1916
2120
|
return {
|
|
1917
2121
|
encoded: encode(buffer),
|
|
@@ -1923,25 +2127,21 @@
|
|
|
1923
2127
|
if (!stateObj.buffers) {
|
|
1924
2128
|
stateObj.buffers = [];
|
|
1925
2129
|
}
|
|
1926
|
-
|
|
1927
2130
|
var byteOffset = b64Obj.byteOffset,
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
2131
|
+
len = b64Obj.length,
|
|
2132
|
+
encoded = b64Obj.encoded,
|
|
2133
|
+
index = b64Obj.index;
|
|
1931
2134
|
var buffer;
|
|
1932
|
-
|
|
1933
2135
|
if ('index' in b64Obj) {
|
|
1934
2136
|
buffer = stateObj.buffers[index];
|
|
1935
2137
|
} else {
|
|
1936
2138
|
buffer = decode(encoded);
|
|
1937
2139
|
stateObj.buffers.push(buffer);
|
|
1938
2140
|
}
|
|
1939
|
-
|
|
1940
2141
|
return new TypedArray(buffer, byteOffset, len);
|
|
1941
2142
|
}
|
|
1942
2143
|
};
|
|
1943
2144
|
}
|
|
1944
|
-
|
|
1945
2145
|
if (typeof Int8Array === 'function') {
|
|
1946
2146
|
// Those constructors are added in ES6 as a group.
|
|
1947
2147
|
// If we have Int8Array, we can assume the rest also exists.
|
|
@@ -1986,7 +2186,8 @@
|
|
|
1986
2186
|
testPlainObjects: true,
|
|
1987
2187
|
test: function test(x, stateObj) {
|
|
1988
2188
|
if (Array.isArray(x)) {
|
|
1989
|
-
if (
|
|
2189
|
+
if (
|
|
2190
|
+
// By avoiding serializing arrays into objects which
|
|
1990
2191
|
// have only positive-integer keys, we reduce
|
|
1991
2192
|
// size and improve revival performance; arrays with
|
|
1992
2193
|
// non-index keys will be larger however
|
|
@@ -2003,10 +2204,8 @@
|
|
|
2003
2204
|
stateObj.iterateIn = 'object';
|
|
2004
2205
|
stateObj.addLength = true;
|
|
2005
2206
|
}
|
|
2006
|
-
|
|
2007
2207
|
return true;
|
|
2008
2208
|
}
|
|
2009
|
-
|
|
2010
2209
|
return false;
|
|
2011
2210
|
},
|
|
2012
2211
|
replace: function replace(a, stateObj) {
|
|
@@ -2018,12 +2217,11 @@
|
|
|
2018
2217
|
if (Array.isArray(o)) {
|
|
2019
2218
|
return o;
|
|
2020
2219
|
}
|
|
2021
|
-
|
|
2022
|
-
|
|
2220
|
+
var arr = [];
|
|
2221
|
+
// No map here as may be a sparse array (including
|
|
2023
2222
|
// with `length` set)
|
|
2024
2223
|
// Todo: Reenable when Node `engines` >= 7
|
|
2025
2224
|
// Object.entries(o).forEach(([key, val]) => {
|
|
2026
|
-
|
|
2027
2225
|
Object.keys(o).forEach(function (key) {
|
|
2028
2226
|
var val = o[key];
|
|
2029
2227
|
arr[key] = val;
|
|
@@ -2042,7 +2240,6 @@
|
|
|
2042
2240
|
revive: function revive(s) {
|
|
2043
2241
|
return undefined;
|
|
2044
2242
|
} // Will avoid adding anything
|
|
2045
|
-
|
|
2046
2243
|
}
|
|
2047
2244
|
}];
|
|
2048
2245
|
|
|
@@ -2063,22 +2260,17 @@
|
|
|
2063
2260
|
|
|
2064
2261
|
Symbols are similarly not included.
|
|
2065
2262
|
*/
|
|
2066
|
-
var expObj$1 = [undef$1,
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
typeof Map === 'function' ? map : [],
|
|
2071
|
-
/* c8 ignore next */
|
|
2072
|
-
typeof Set === 'function' ? set : [],
|
|
2073
|
-
/* c8 ignore next */
|
|
2074
|
-
typeof ArrayBuffer === 'function' ? arraybuffer : [],
|
|
2075
|
-
/* c8 ignore next */
|
|
2076
|
-
typeof Uint8Array === 'function' ? typedArrays : [],
|
|
2077
|
-
/* c8 ignore next */
|
|
2078
|
-
typeof DataView === 'function' ? dataview : [],
|
|
2079
|
-
/* c8 ignore next */
|
|
2080
|
-
typeof Intl !== 'undefined' ? intlTypes : [],
|
|
2263
|
+
var expObj$1 = [undef$1,
|
|
2264
|
+
// ES5
|
|
2265
|
+
arrayNonindexKeys, primitiveObjects, specialNumbers, date, error, errors, regexp].concat(
|
|
2266
|
+
// ES2015 (ES6)
|
|
2081
2267
|
/* c8 ignore next */
|
|
2268
|
+
typeof Map === 'function' ? map : [], /* c8 ignore next */
|
|
2269
|
+
typeof Set === 'function' ? set : [], /* c8 ignore next */
|
|
2270
|
+
typeof ArrayBuffer === 'function' ? arraybuffer : [], /* c8 ignore next */
|
|
2271
|
+
typeof Uint8Array === 'function' ? typedArrays : [], /* c8 ignore next */
|
|
2272
|
+
typeof DataView === 'function' ? dataview : [], /* c8 ignore next */
|
|
2273
|
+
typeof Intl !== 'undefined' ? intlTypes : [], /* c8 ignore next */
|
|
2082
2274
|
typeof BigInt !== 'undefined' ? [bigint, bigintObject] : []);
|
|
2083
2275
|
|
|
2084
2276
|
/*
|
|
@@ -2098,10 +2290,12 @@
|
|
|
2098
2290
|
*/
|
|
2099
2291
|
var postmessage = [error, errors];
|
|
2100
2292
|
|
|
2101
|
-
var socketio = [expObj$1,
|
|
2293
|
+
var socketio = [expObj$1,
|
|
2294
|
+
// Leave ArrayBuffer as is, and let socket.io stream it instead.
|
|
2102
2295
|
{
|
|
2103
2296
|
arraybuffer: null
|
|
2104
|
-
},
|
|
2297
|
+
},
|
|
2298
|
+
// Encapsulate TypedArrays in ArrayBuffers instead of base64 strings.
|
|
2105
2299
|
typedArraysSocketIO];
|
|
2106
2300
|
|
|
2107
2301
|
var sparseUndefined = [{
|
|
@@ -2126,34 +2320,31 @@
|
|
|
2126
2320
|
revive: function revive(s) {
|
|
2127
2321
|
return undefined;
|
|
2128
2322
|
} // Will avoid adding anything
|
|
2129
|
-
|
|
2130
2323
|
}
|
|
2131
2324
|
}];
|
|
2132
2325
|
|
|
2133
2326
|
/* This preset includes types for the Structured Cloning Algorithm. */
|
|
2134
|
-
var expObj = [
|
|
2327
|
+
var expObj = [
|
|
2328
|
+
// Todo: Might also register synchronous `ImageBitmap` and
|
|
2135
2329
|
// `Blob`/`File`/`FileList`?
|
|
2136
2330
|
// ES5
|
|
2137
|
-
userObject,
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
/* c8 ignore next */
|
|
2147
|
-
typeof ArrayBuffer === 'function' ? arraybuffer : [],
|
|
2148
|
-
/* c8 ignore next */
|
|
2149
|
-
typeof Uint8Array === 'function' ? typedArrays : [],
|
|
2150
|
-
/* c8 ignore next */
|
|
2151
|
-
typeof DataView === 'function' ? dataview : [],
|
|
2152
|
-
/* c8 ignore next */
|
|
2153
|
-
typeof Intl !== 'undefined' ? intlTypes : [],
|
|
2154
|
-
/* c8 ignore next */
|
|
2155
|
-
typeof crypto !== 'undefined' ? cryptokey : [],
|
|
2331
|
+
userObject,
|
|
2332
|
+
// Processed last (non-builtin)
|
|
2333
|
+
|
|
2334
|
+
undef$1, arrayNonindexKeys, primitiveObjects, specialNumbers, date, regexp,
|
|
2335
|
+
// Non-built-ins
|
|
2336
|
+
imagedata, imagebitmap,
|
|
2337
|
+
// Async return
|
|
2338
|
+
file, filelist, blob, error, errors].concat(
|
|
2339
|
+
// ES2015 (ES6)
|
|
2156
2340
|
/* c8 ignore next */
|
|
2341
|
+
typeof Map === 'function' ? map : [], /* c8 ignore next */
|
|
2342
|
+
typeof Set === 'function' ? set : [], /* c8 ignore next */
|
|
2343
|
+
typeof ArrayBuffer === 'function' ? arraybuffer : [], /* c8 ignore next */
|
|
2344
|
+
typeof Uint8Array === 'function' ? typedArrays : [], /* c8 ignore next */
|
|
2345
|
+
typeof DataView === 'function' ? dataview : [], /* c8 ignore next */
|
|
2346
|
+
typeof Intl !== 'undefined' ? intlTypes : [], /* c8 ignore next */
|
|
2347
|
+
typeof crypto !== 'undefined' ? cryptokey : [], /* c8 ignore next */
|
|
2157
2348
|
typeof BigInt !== 'undefined' ? [bigint, bigintObject] : []);
|
|
2158
2349
|
|
|
2159
2350
|
var structuredCloningThrowing = expObj.concat({
|
|
@@ -2180,34 +2371,43 @@
|
|
|
2180
2371
|
// Note: There is no apparent way for us to detect a `Proxy` and
|
|
2181
2372
|
// reject (Chrome at least is not rejecting anyways)
|
|
2182
2373
|
var stringTag = {}.toString.call(val).slice(8, -1);
|
|
2183
|
-
|
|
2184
|
-
|
|
2374
|
+
if ([
|
|
2375
|
+
// Symbol's `toStringTag` is only "Symbol" for its initial
|
|
2185
2376
|
// value, so we check `typeof`
|
|
2186
|
-
'symbol',
|
|
2187
|
-
|
|
2188
|
-
'
|
|
2189
|
-
|
|
2377
|
+
'symbol',
|
|
2378
|
+
// All functions including bound function exotic objects
|
|
2379
|
+
'function'].includes(_typeof$1(val)) || [
|
|
2380
|
+
// A non-array exotic object
|
|
2381
|
+
'Arguments',
|
|
2382
|
+
// A non-array exotic object
|
|
2383
|
+
'Module',
|
|
2384
|
+
// `Error` and other errors have the [[ErrorData]] internal
|
|
2190
2385
|
// slot and give "Error"
|
|
2191
|
-
'Error',
|
|
2386
|
+
'Error',
|
|
2387
|
+
// Promise instances have an extra slot ([[PromiseState]])
|
|
2192
2388
|
// but not throwing in Chrome `postMessage`
|
|
2193
|
-
'Promise',
|
|
2389
|
+
'Promise',
|
|
2390
|
+
// WeakMap instances have an extra slot ([[WeakMapData]])
|
|
2194
2391
|
// but not throwing in Chrome `postMessage`
|
|
2195
|
-
'WeakMap',
|
|
2392
|
+
'WeakMap',
|
|
2393
|
+
// WeakSet instances have an extra slot ([[WeakSetData]])
|
|
2196
2394
|
// but not throwing in Chrome `postMessage`
|
|
2197
|
-
'WeakSet',
|
|
2198
|
-
|
|
2395
|
+
'WeakSet',
|
|
2396
|
+
// HTML-SPECIFIC
|
|
2397
|
+
'Event',
|
|
2398
|
+
// Also in Node `worker_threads` (currently experimental)
|
|
2199
2399
|
'MessageChannel'].includes(stringTag) ||
|
|
2200
2400
|
/*
|
|
2201
2401
|
// isClosed is no longer documented
|
|
2202
2402
|
((stringTag === 'Blob' || stringTag === 'File') &&
|
|
2203
2403
|
val.isClosed) ||
|
|
2204
2404
|
*/
|
|
2205
|
-
val && _typeof$1(val) === 'object' &&
|
|
2405
|
+
val && _typeof$1(val) === 'object' &&
|
|
2406
|
+
// Duck-type DOM node objects (non-array exotic?
|
|
2206
2407
|
// objects which cannot be cloned by the SCA)
|
|
2207
2408
|
typeof val.nodeType === 'number' && typeof val.insertBefore === 'function') {
|
|
2208
2409
|
throw new DOMException('The object cannot be cloned.', 'DataCloneError');
|
|
2209
2410
|
}
|
|
2210
|
-
|
|
2211
2411
|
return false;
|
|
2212
2412
|
}
|
|
2213
2413
|
}
|
|
@@ -2215,11 +2415,12 @@
|
|
|
2215
2415
|
|
|
2216
2416
|
var undef = [sparseUndefined, undef$1];
|
|
2217
2417
|
|
|
2218
|
-
var universal = [expObj$1
|
|
2418
|
+
var universal = [expObj$1
|
|
2419
|
+
// TODO: Add types that are de-facto universal even though not
|
|
2219
2420
|
// built-in into ecmasript standard.
|
|
2220
2421
|
];
|
|
2221
2422
|
|
|
2222
|
-
exports.JSON_TYPES =
|
|
2423
|
+
exports.JSON_TYPES = l;
|
|
2223
2424
|
exports.Typeson = u;
|
|
2224
2425
|
exports.TypesonPromise = e;
|
|
2225
2426
|
exports.Undefined = p;
|
|
@@ -2273,7 +2474,5 @@
|
|
|
2273
2474
|
exports.universal = universal;
|
|
2274
2475
|
exports.userObject = userObject;
|
|
2275
2476
|
|
|
2276
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2277
|
-
|
|
2278
2477
|
}));
|
|
2279
2478
|
//# sourceMappingURL=index.umd.js.map
|