typeson-registry 12.0.0 → 13.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 +28 -22
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +6 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.cjs +655 -725
- package/dist/index.umd.cjs.map +1 -1
- package/dist/index.umd.min.cjs +7 -2
- package/dist/index.umd.min.cjs.map +1 -1
- package/dist/polyfills/createObjectURL.d.ts.map +1 -1
- package/dist/presets/array-nonindex-keys.umd.cjs +1 -1
- package/dist/presets/array-nonindex-keys.umd.cjs.map +1 -1
- package/dist/presets/builtin.umd.cjs +1 -1
- package/dist/presets/builtin.umd.cjs.map +1 -1
- package/dist/presets/postmessage.umd.cjs +1 -1
- package/dist/presets/postmessage.umd.cjs.map +1 -1
- package/dist/presets/socketio.umd.cjs +1 -1
- package/dist/presets/socketio.umd.cjs.map +1 -1
- package/dist/presets/special-numbers.umd.cjs +1 -1
- package/dist/presets/special-numbers.umd.cjs.map +1 -1
- package/dist/presets/structured-cloning-throwing.umd.cjs +2 -2
- package/dist/presets/structured-cloning-throwing.umd.cjs.map +1 -1
- package/dist/presets/structured-cloning.umd.cjs +2 -2
- package/dist/presets/structured-cloning.umd.cjs.map +1 -1
- package/dist/presets/undef.umd.cjs +1 -1
- package/dist/presets/undef.umd.cjs.map +1 -1
- package/dist/presets/universal.umd.cjs +1 -1
- package/dist/presets/universal.umd.cjs.map +1 -1
- package/dist/types/arraybuffer.umd.cjs +1 -1
- package/dist/types/arraybuffer.umd.cjs.map +1 -1
- package/dist/types/bigint-object.umd.cjs +1 -1
- package/dist/types/bigint-object.umd.cjs.map +1 -1
- package/dist/types/blob.umd.cjs +1 -1
- package/dist/types/blob.umd.cjs.map +1 -1
- package/dist/types/cloneable.umd.cjs.map +1 -1
- package/dist/types/cryptokey.umd.cjs +2 -2
- package/dist/types/cryptokey.umd.cjs.map +1 -1
- package/dist/types/dataview.umd.cjs +1 -1
- package/dist/types/dataview.umd.cjs.map +1 -1
- package/dist/types/date.umd.cjs +1 -1
- package/dist/types/date.umd.cjs.map +1 -1
- package/dist/types/domexception.umd.cjs +1 -1
- package/dist/types/domexception.umd.cjs.map +1 -1
- package/dist/types/dommatrix.umd.cjs +1 -1
- package/dist/types/dommatrix.umd.cjs.map +1 -1
- package/dist/types/dompoint.umd.cjs +1 -1
- package/dist/types/dompoint.umd.cjs.map +1 -1
- package/dist/types/domquad.umd.cjs +1 -1
- package/dist/types/domquad.umd.cjs.map +1 -1
- package/dist/types/domrect.umd.cjs +1 -1
- package/dist/types/domrect.umd.cjs.map +1 -1
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/error.umd.cjs +1 -1
- package/dist/types/error.umd.cjs.map +1 -1
- package/dist/types/errors.umd.cjs +1 -1
- package/dist/types/errors.umd.cjs.map +1 -1
- package/dist/types/file.umd.cjs +1 -1
- package/dist/types/file.umd.cjs.map +1 -1
- package/dist/types/filelist.umd.cjs +1 -1
- package/dist/types/filelist.umd.cjs.map +1 -1
- package/dist/types/imagebitmap.umd.cjs +2 -2
- package/dist/types/imagebitmap.umd.cjs.map +1 -1
- package/dist/types/imagedata.umd.cjs +1 -1
- package/dist/types/imagedata.umd.cjs.map +1 -1
- package/dist/types/infinity.umd.cjs +1 -1
- package/dist/types/infinity.umd.cjs.map +1 -1
- package/dist/types/intl-types.umd.cjs +1 -1
- package/dist/types/intl-types.umd.cjs.map +1 -1
- package/dist/types/map.umd.cjs +1 -1
- package/dist/types/map.umd.cjs.map +1 -1
- package/dist/types/nan.umd.cjs +1 -1
- package/dist/types/nan.umd.cjs.map +1 -1
- package/dist/types/negative-infinity.umd.cjs +1 -1
- package/dist/types/negative-infinity.umd.cjs.map +1 -1
- package/dist/types/nonbuiltin-ignore.umd.cjs +1 -1
- package/dist/types/nonbuiltin-ignore.umd.cjs.map +1 -1
- package/dist/types/primitive-objects.umd.cjs +1 -1
- package/dist/types/primitive-objects.umd.cjs.map +1 -1
- package/dist/types/promise.umd.cjs +2 -2
- package/dist/types/promise.umd.cjs.map +1 -1
- package/dist/types/regexp.umd.cjs +1 -1
- package/dist/types/regexp.umd.cjs.map +1 -1
- package/dist/types/resurrectable.umd.cjs.map +1 -1
- package/dist/types/set.umd.cjs +1 -1
- package/dist/types/set.umd.cjs.map +1 -1
- package/dist/types/typed-arrays-socketio.umd.cjs +1 -1
- package/dist/types/typed-arrays-socketio.umd.cjs.map +1 -1
- package/dist/types/typed-arrays.umd.cjs +1 -1
- package/dist/types/typed-arrays.umd.cjs.map +1 -1
- package/dist/types/undef.umd.cjs +1 -1
- package/dist/types/undef.umd.cjs.map +1 -1
- package/dist/types/user-object.umd.cjs +1 -1
- package/dist/types/user-object.umd.cjs.map +1 -1
- package/package.json +30 -28
- package/polyfills/createObjectURL.js +7 -3
- package/polyfills/createObjectURL.umd.cjs +2 -2
- package/polyfills/createObjectURL.umd.cjs.map +1 -1
- package/utils/generateUUID.js +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TypesonNamespace = {}));
|
|
5
5
|
})(this, (function (exports) { 'use strict';
|
|
6
6
|
|
|
7
|
-
function _arrayLikeToArray
|
|
7
|
+
function _arrayLikeToArray(r, a) {
|
|
8
8
|
(null == a || a > r.length) && (a = r.length);
|
|
9
9
|
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
10
10
|
return n;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
if (Array.isArray(r)) return r;
|
|
14
14
|
}
|
|
15
15
|
function _arrayWithoutHoles(r) {
|
|
16
|
-
if (Array.isArray(r)) return _arrayLikeToArray
|
|
16
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
17
17
|
}
|
|
18
18
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
19
19
|
try {
|
|
@@ -40,22 +40,22 @@
|
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
function _classCallCheck
|
|
43
|
+
function _classCallCheck(a, n) {
|
|
44
44
|
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
45
45
|
}
|
|
46
46
|
function _defineProperties(e, r) {
|
|
47
47
|
for (var t = 0; t < r.length; t++) {
|
|
48
48
|
var o = r[t];
|
|
49
|
-
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey
|
|
49
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function _createClass
|
|
52
|
+
function _createClass(e, r, t) {
|
|
53
53
|
return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
|
|
54
54
|
writable: false
|
|
55
55
|
}), e;
|
|
56
56
|
}
|
|
57
|
-
function _defineProperty
|
|
58
|
-
return (r = _toPropertyKey
|
|
57
|
+
function _defineProperty(e, r, t) {
|
|
58
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
59
59
|
value: t,
|
|
60
60
|
enumerable: true,
|
|
61
61
|
configurable: true,
|
|
@@ -76,7 +76,10 @@
|
|
|
76
76
|
f = true,
|
|
77
77
|
o = false;
|
|
78
78
|
try {
|
|
79
|
-
if (i = (t = t.call(r)).next, 0 === l)
|
|
79
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
80
|
+
if (Object(t) !== t) return;
|
|
81
|
+
f = !1;
|
|
82
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
80
83
|
} catch (r) {
|
|
81
84
|
o = true, n = r;
|
|
82
85
|
} finally {
|
|
@@ -95,7 +98,7 @@
|
|
|
95
98
|
function _nonIterableSpread() {
|
|
96
99
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
97
100
|
}
|
|
98
|
-
function ownKeys
|
|
101
|
+
function ownKeys(e, r) {
|
|
99
102
|
var t = Object.keys(e);
|
|
100
103
|
if (Object.getOwnPropertySymbols) {
|
|
101
104
|
var o = Object.getOwnPropertySymbols(e);
|
|
@@ -105,12 +108,12 @@
|
|
|
105
108
|
}
|
|
106
109
|
return t;
|
|
107
110
|
}
|
|
108
|
-
function _objectSpread2
|
|
111
|
+
function _objectSpread2(e) {
|
|
109
112
|
for (var r = 1; r < arguments.length; r++) {
|
|
110
113
|
var t = null != arguments[r] ? arguments[r] : {};
|
|
111
|
-
r % 2 ? ownKeys
|
|
112
|
-
_defineProperty
|
|
113
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys
|
|
114
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
|
115
|
+
_defineProperty(e, r, t[r]);
|
|
116
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
114
117
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
115
118
|
});
|
|
116
119
|
}
|
|
@@ -224,11 +227,11 @@
|
|
|
224
227
|
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
225
228
|
}, _regeneratorDefine(e, r, n, t);
|
|
226
229
|
}
|
|
227
|
-
function _slicedToArray
|
|
228
|
-
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray
|
|
230
|
+
function _slicedToArray(r, e) {
|
|
231
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
229
232
|
}
|
|
230
|
-
function _toConsumableArray
|
|
231
|
-
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray
|
|
233
|
+
function _toConsumableArray(r) {
|
|
234
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
232
235
|
}
|
|
233
236
|
function _toPrimitive(t, r) {
|
|
234
237
|
if ("object" != typeof t || !t) return t;
|
|
@@ -240,213 +243,99 @@
|
|
|
240
243
|
}
|
|
241
244
|
return ("string" === r ? String : Number)(t);
|
|
242
245
|
}
|
|
243
|
-
function _toPropertyKey
|
|
246
|
+
function _toPropertyKey(t) {
|
|
244
247
|
var i = _toPrimitive(t, "string");
|
|
245
248
|
return "symbol" == typeof i ? i : i + "";
|
|
246
249
|
}
|
|
247
|
-
function _typeof
|
|
250
|
+
function _typeof(o) {
|
|
248
251
|
"@babel/helpers - typeof";
|
|
249
252
|
|
|
250
|
-
return _typeof
|
|
253
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
251
254
|
return typeof o;
|
|
252
255
|
} : function (o) {
|
|
253
256
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
254
|
-
}, _typeof
|
|
257
|
+
}, _typeof(o);
|
|
255
258
|
}
|
|
256
|
-
function _unsupportedIterableToArray
|
|
259
|
+
function _unsupportedIterableToArray(r, a) {
|
|
257
260
|
if (r) {
|
|
258
|
-
if ("string" == typeof r) return _arrayLikeToArray
|
|
261
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
259
262
|
var t = {}.toString.call(r).slice(8, -1);
|
|
260
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray
|
|
263
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
261
264
|
}
|
|
262
265
|
}
|
|
263
266
|
|
|
264
|
-
function
|
|
265
|
-
(
|
|
266
|
-
|
|
267
|
-
return n;
|
|
268
|
-
}
|
|
269
|
-
function _classCallCheck(e, t) {
|
|
270
|
-
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
271
|
-
}
|
|
272
|
-
function _createClass(e, t, r) {
|
|
273
|
-
return t && function _defineProperties(e, t) {
|
|
274
|
-
for (var r = 0; r < t.length; r++) {
|
|
275
|
-
var n = t[r];
|
|
276
|
-
n.enumerable = n.enumerable || false, n.configurable = true, "value" in n && (n.writable = true), Object.defineProperty(e, _toPropertyKey(n.key), n);
|
|
277
|
-
}
|
|
278
|
-
}(e.prototype, t), Object.defineProperty(e, "prototype", {
|
|
279
|
-
writable: false
|
|
280
|
-
}), e;
|
|
281
|
-
}
|
|
282
|
-
function _defineProperty(e, t, r) {
|
|
283
|
-
return (t = _toPropertyKey(t)) in e ? Object.defineProperty(e, t, {
|
|
284
|
-
value: r,
|
|
285
|
-
enumerable: true,
|
|
286
|
-
configurable: true,
|
|
287
|
-
writable: true
|
|
288
|
-
}) : e[t] = r, e;
|
|
289
|
-
}
|
|
290
|
-
function ownKeys(e, t) {
|
|
291
|
-
var r = Object.keys(e);
|
|
292
|
-
if (Object.getOwnPropertySymbols) {
|
|
293
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
294
|
-
t && (n = n.filter(function (t) {
|
|
295
|
-
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
296
|
-
})), r.push.apply(r, n);
|
|
297
|
-
}
|
|
298
|
-
return r;
|
|
299
|
-
}
|
|
300
|
-
function _objectSpread2(e) {
|
|
301
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
302
|
-
var r = null != arguments[t] ? arguments[t] : {};
|
|
303
|
-
t % 2 ? ownKeys(Object(r), true).forEach(function (t) {
|
|
304
|
-
_defineProperty(e, t, r[t]);
|
|
305
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ownKeys(Object(r)).forEach(function (t) {
|
|
306
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
return e;
|
|
310
|
-
}
|
|
311
|
-
function _slicedToArray(e, t) {
|
|
312
|
-
return function _arrayWithHoles(e) {
|
|
313
|
-
if (Array.isArray(e)) return e;
|
|
314
|
-
}(e) || function _iterableToArrayLimit(e, t) {
|
|
315
|
-
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
316
|
-
if (null != r) {
|
|
317
|
-
var n,
|
|
318
|
-
o,
|
|
319
|
-
i,
|
|
320
|
-
a,
|
|
321
|
-
c = [],
|
|
322
|
-
s = true,
|
|
323
|
-
u = false;
|
|
324
|
-
try {
|
|
325
|
-
if (i = (r = r.call(e)).next, 0 === t) {
|
|
326
|
-
if (Object(r) !== r) return;
|
|
327
|
-
s = !1;
|
|
328
|
-
} else for (; !(s = (n = i.call(r)).done) && (c.push(n.value), c.length !== t); s = !0);
|
|
329
|
-
} catch (e) {
|
|
330
|
-
u = true, o = e;
|
|
331
|
-
} finally {
|
|
332
|
-
try {
|
|
333
|
-
if (!s && null != r["return"] && (a = r["return"](), Object(a) !== a)) return;
|
|
334
|
-
} finally {
|
|
335
|
-
if (u) throw o;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
return c;
|
|
339
|
-
}
|
|
340
|
-
}(e, t) || _unsupportedIterableToArray(e, t) || function _nonIterableRest() {
|
|
341
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
342
|
-
}();
|
|
343
|
-
}
|
|
344
|
-
function _toConsumableArray(e) {
|
|
345
|
-
return function _arrayWithoutHoles(e) {
|
|
346
|
-
if (Array.isArray(e)) return _arrayLikeToArray(e);
|
|
347
|
-
}(e) || function _iterableToArray(e) {
|
|
348
|
-
if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
|
|
349
|
-
}(e) || _unsupportedIterableToArray(e) || function _nonIterableSpread() {
|
|
350
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
351
|
-
}();
|
|
352
|
-
}
|
|
353
|
-
function _toPropertyKey(e) {
|
|
354
|
-
var t = function _toPrimitive(e, t) {
|
|
355
|
-
if ("object" != _typeof$1(e) || !e) return e;
|
|
356
|
-
var r = e[Symbol.toPrimitive];
|
|
357
|
-
if (void 0 !== r) {
|
|
358
|
-
var n = r.call(e, t);
|
|
359
|
-
if ("object" != _typeof$1(n)) return n;
|
|
360
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
361
|
-
}
|
|
362
|
-
return String(e);
|
|
363
|
-
}(e, "string");
|
|
364
|
-
return "symbol" == _typeof$1(t) ? t : t + "";
|
|
365
|
-
}
|
|
366
|
-
function _typeof(e) {
|
|
367
|
-
return _typeof = "function" == typeof Symbol && "symbol" == _typeof$1(Symbol.iterator) ? function (e) {
|
|
368
|
-
return _typeof$1(e);
|
|
369
|
-
} : function (e) {
|
|
370
|
-
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof$1(e);
|
|
371
|
-
}, _typeof(e);
|
|
372
|
-
}
|
|
373
|
-
function _unsupportedIterableToArray(e, t) {
|
|
374
|
-
if (e) {
|
|
375
|
-
if ("string" == typeof e) return _arrayLikeToArray(e, t);
|
|
376
|
-
var r = {}.toString.call(e).slice(8, -1);
|
|
377
|
-
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;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
var e = _createClass(function TypesonPromise(e) {
|
|
381
|
-
_classCallCheck(this, TypesonPromise), this.p = new Promise(e);
|
|
267
|
+
var TypesonPromise = /*#__PURE__*/_createClass(function TypesonPromise(e) {
|
|
268
|
+
_classCallCheck(this, TypesonPromise);
|
|
269
|
+
this.p = new Promise(e);
|
|
382
270
|
});
|
|
383
|
-
|
|
271
|
+
TypesonPromise.__typeson__type__ = "TypesonPromise", "undefined" != typeof Symbol && Object.defineProperty(TypesonPromise.prototype, Symbol.toStringTag, {
|
|
384
272
|
get: function get() {
|
|
385
273
|
return "TypesonPromise";
|
|
386
274
|
}
|
|
387
|
-
}),
|
|
388
|
-
var
|
|
389
|
-
return new
|
|
390
|
-
|
|
391
|
-
e
|
|
275
|
+
}), TypesonPromise.prototype.then = function (e, t) {
|
|
276
|
+
var _this = this;
|
|
277
|
+
return new TypesonPromise(function (n, r) {
|
|
278
|
+
_this.p.then(function (t) {
|
|
279
|
+
n(e ? e(t) : t);
|
|
392
280
|
})["catch"](function (e) {
|
|
393
|
-
return
|
|
394
|
-
}).then(
|
|
281
|
+
return t ? t(e) : Promise.reject(e);
|
|
282
|
+
}).then(n, r);
|
|
395
283
|
});
|
|
396
|
-
},
|
|
284
|
+
}, TypesonPromise.prototype["catch"] = function (e) {
|
|
397
285
|
return this.then(function () {}, e);
|
|
398
|
-
},
|
|
399
|
-
return new
|
|
400
|
-
e
|
|
286
|
+
}, TypesonPromise.resolve = function (e) {
|
|
287
|
+
return new TypesonPromise(function (t) {
|
|
288
|
+
t(e);
|
|
401
289
|
});
|
|
402
|
-
},
|
|
403
|
-
return new
|
|
404
|
-
|
|
290
|
+
}, TypesonPromise.reject = function (e) {
|
|
291
|
+
return new TypesonPromise(function (t, n) {
|
|
292
|
+
n(e);
|
|
405
293
|
});
|
|
406
|
-
},
|
|
407
|
-
return new
|
|
408
|
-
Promise.all(
|
|
409
|
-
return null
|
|
410
|
-
})).then(
|
|
294
|
+
}, TypesonPromise.all = function (e) {
|
|
295
|
+
return new TypesonPromise(function (t, n) {
|
|
296
|
+
Promise.all(e.map(function (e) {
|
|
297
|
+
return e !== null && e !== void 0 && e.constructor && "__typeson__type__" in e.constructor && "TypesonPromise" === e.constructor.__typeson__type__ ? e.p : e;
|
|
298
|
+
})).then(t, n);
|
|
411
299
|
});
|
|
412
|
-
},
|
|
413
|
-
return new
|
|
414
|
-
Promise.race(
|
|
415
|
-
return null
|
|
416
|
-
})).then(
|
|
300
|
+
}, TypesonPromise.race = function (e) {
|
|
301
|
+
return new TypesonPromise(function (t, n) {
|
|
302
|
+
Promise.race(e.map(function (e) {
|
|
303
|
+
return e !== null && e !== void 0 && e.constructor && "__typeson__type__" in e.constructor && "TypesonPromise" === e.constructor.__typeson__type__ ? e.p : e;
|
|
304
|
+
})).then(t, n);
|
|
417
305
|
});
|
|
418
|
-
},
|
|
419
|
-
return new
|
|
420
|
-
Promise.allSettled(
|
|
421
|
-
return null
|
|
422
|
-
})).then(
|
|
306
|
+
}, TypesonPromise.allSettled = function (e) {
|
|
307
|
+
return new TypesonPromise(function (t, n) {
|
|
308
|
+
Promise.allSettled(e.map(function (e) {
|
|
309
|
+
return e !== null && e !== void 0 && e.constructor && "__typeson__type__" in e.constructor && "TypesonPromise" === e.constructor.__typeson__type__ ? e.p : e;
|
|
310
|
+
})).then(t, n);
|
|
423
311
|
});
|
|
424
312
|
};
|
|
425
|
-
var
|
|
426
|
-
|
|
313
|
+
var e = Object.hasOwn,
|
|
314
|
+
t = Object.getPrototypeOf;
|
|
427
315
|
function isThenable(e, t) {
|
|
428
316
|
return isObject(e) && "function" == typeof e.then && (!t || "function" == typeof e["catch"]);
|
|
429
317
|
}
|
|
430
318
|
function toStringTag(e) {
|
|
431
319
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
432
320
|
}
|
|
433
|
-
function hasConstructorOf(
|
|
434
|
-
if (!
|
|
435
|
-
var
|
|
436
|
-
if (!
|
|
437
|
-
var
|
|
438
|
-
return "function" != typeof
|
|
321
|
+
function hasConstructorOf(n, r) {
|
|
322
|
+
if (!n || "object" != _typeof(n)) return false;
|
|
323
|
+
var s = t(n);
|
|
324
|
+
if (!s) return null === r;
|
|
325
|
+
var o = e(s, "constructor") && s.constructor;
|
|
326
|
+
return "function" != typeof o ? null === r : r === o || null !== r && Function.prototype.toString.call(o) === Function.prototype.toString.call(r) || "function" == typeof r && "string" == typeof o.__typeson__type__ && o.__typeson__type__ === r.__typeson__type__;
|
|
439
327
|
}
|
|
440
328
|
function isPlainObject(e) {
|
|
441
|
-
|
|
329
|
+
if (!e || "Object" !== toStringTag(e)) return false;
|
|
330
|
+
return !t(e) || hasConstructorOf(e, Object);
|
|
442
331
|
}
|
|
443
332
|
function isUserObject(e) {
|
|
444
333
|
if (!e || "Object" !== toStringTag(e)) return false;
|
|
445
|
-
var
|
|
446
|
-
return !
|
|
334
|
+
var n = t(e);
|
|
335
|
+
return !n || hasConstructorOf(e, Object) || isUserObject(n);
|
|
447
336
|
}
|
|
448
337
|
function isObject(e) {
|
|
449
|
-
return null !== e && "object"
|
|
338
|
+
return null !== e && "object" == _typeof(e);
|
|
450
339
|
}
|
|
451
340
|
function escapeKeyPathComponent(e) {
|
|
452
341
|
return e.replaceAll("''", "''''").replace(/^$/, "''").replaceAll("~", "~0").replaceAll(".", "~1");
|
|
@@ -456,535 +345,575 @@
|
|
|
456
345
|
}
|
|
457
346
|
function getByKeyPath(e, t) {
|
|
458
347
|
if ("" === t) return e;
|
|
459
|
-
if (null === e || "object"
|
|
460
|
-
var
|
|
461
|
-
if (-1 !==
|
|
462
|
-
var
|
|
463
|
-
return void 0 ===
|
|
348
|
+
if (null === e || "object" != _typeof(e)) throw new TypeError("Unexpected non-object type");
|
|
349
|
+
var n = t.indexOf(".");
|
|
350
|
+
if (-1 !== n) {
|
|
351
|
+
var _r = e[unescapeKeyPathComponent(t.slice(0, n))];
|
|
352
|
+
return void 0 === _r ? void 0 : getByKeyPath(_r, t.slice(n + 1));
|
|
464
353
|
}
|
|
465
354
|
return e[unescapeKeyPathComponent(t)];
|
|
466
355
|
}
|
|
467
|
-
function setAtKeyPath(e, t,
|
|
468
|
-
if ("" === t) return
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
356
|
+
function setAtKeyPath(e, t, n) {
|
|
357
|
+
if ("" === t) return n;
|
|
358
|
+
var r = e,
|
|
359
|
+
s = t;
|
|
360
|
+
for (;;) {
|
|
361
|
+
if (!r || "object" != _typeof(r)) throw new TypeError("Unexpected non-object type");
|
|
362
|
+
if ("__proto__" === s) throw new TypeError("Invalid property");
|
|
363
|
+
var _t = s.indexOf(".");
|
|
364
|
+
if (-1 === _t) return r[unescapeKeyPathComponent(s)] = n, e;
|
|
365
|
+
r = r[unescapeKeyPathComponent(s.slice(0, _t))], s = s.slice(_t + 1);
|
|
366
|
+
}
|
|
473
367
|
}
|
|
474
368
|
function getJSONType(e) {
|
|
475
369
|
return null === e ? "null" : Array.isArray(e) ? "array" : _typeof(e);
|
|
476
370
|
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
371
|
+
/**
|
|
372
|
+
* @file Typeson - JSON with types.
|
|
373
|
+
* @license The MIT License (MIT)
|
|
374
|
+
* @copyright (c) 2016-2018 David Fahlander, Brett Zamir
|
|
375
|
+
*/
|
|
480
376
|
var n = Object.keys,
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
function _async(e) {
|
|
485
|
-
return function () {
|
|
486
|
-
for (var t = [], r = 0; r < arguments.length; r++) t[r] = arguments[r];
|
|
487
|
-
try {
|
|
488
|
-
return Promise.resolve(e.apply(this, t));
|
|
489
|
-
} catch (e) {
|
|
490
|
-
return Promise.reject(e);
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
}
|
|
377
|
+
r = Object.hasOwn,
|
|
378
|
+
s = Array.isArray,
|
|
379
|
+
o = ["type", "replaced", "iterateIn", "iterateUnsetNumeric", "addLength"];
|
|
494
380
|
function nestedPathsFirst(e, t) {
|
|
495
|
-
var
|
|
381
|
+
var _e$keypath$match, _t$keypath$match;
|
|
496
382
|
if ("" === e.keypath) return -1;
|
|
497
|
-
var
|
|
498
|
-
|
|
499
|
-
return
|
|
500
|
-
}
|
|
501
|
-
var
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
383
|
+
var n = (_e$keypath$match = e.keypath.match(/\./g)) !== null && _e$keypath$match !== void 0 ? _e$keypath$match : 0,
|
|
384
|
+
r = (_t$keypath$match = t.keypath.match(/\./g)) !== null && _t$keypath$match !== void 0 ? _t$keypath$match : 0;
|
|
385
|
+
return n && (n = n.length), r && (r = r.length), n > r ? -1 : n < r ? 1 : e.keypath < t.keypath ? -1 : e.keypath > t.keypath ? 1 : 0;
|
|
386
|
+
}
|
|
387
|
+
var Typeson = /*#__PURE__*/function () {
|
|
388
|
+
function Typeson(e) {
|
|
389
|
+
_classCallCheck(this, Typeson);
|
|
390
|
+
this.options = e, this.plainObjectReplacers = [], this.nonplainObjectReplacers = [], this.revivers = {}, this.types = {};
|
|
391
|
+
}
|
|
392
|
+
return _createClass(Typeson, [{
|
|
393
|
+
key: "stringify",
|
|
394
|
+
value: function stringify(e, t, n, r) {
|
|
395
|
+
r = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), r), {}, {
|
|
396
|
+
stringification: true
|
|
397
|
+
});
|
|
398
|
+
var o = this.encapsulate(e, null, r);
|
|
399
|
+
return s(o) ? JSON.stringify(o[0], t, n) : o.then(function (e) {
|
|
400
|
+
return JSON.stringify(e, t, n);
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
}, {
|
|
404
|
+
key: "stringifySync",
|
|
405
|
+
value: function stringifySync(e, t, n, r) {
|
|
406
|
+
return this.stringify(e, t, n, _objectSpread2(_objectSpread2({
|
|
407
|
+
throwOnBadSyncType: true
|
|
408
|
+
}, r), {}, {
|
|
409
|
+
sync: true
|
|
410
|
+
}));
|
|
411
|
+
}
|
|
412
|
+
}, {
|
|
413
|
+
key: "stringifyAsync",
|
|
414
|
+
value: function stringifyAsync(e, t, n, r) {
|
|
415
|
+
return this.stringify(e, t, n, _objectSpread2(_objectSpread2({
|
|
416
|
+
throwOnBadSyncType: true
|
|
417
|
+
}, r), {}, {
|
|
418
|
+
sync: false
|
|
419
|
+
}));
|
|
420
|
+
}
|
|
421
|
+
}, {
|
|
422
|
+
key: "parse",
|
|
423
|
+
value: function parse(e, t, n) {
|
|
424
|
+
return n = _objectSpread2(_objectSpread2(_objectSpread2({}, this.options), n), {}, {
|
|
425
|
+
parse: true
|
|
426
|
+
}), this.revive(JSON.parse(e, t), n);
|
|
427
|
+
}
|
|
428
|
+
}, {
|
|
429
|
+
key: "parseSync",
|
|
430
|
+
value: function parseSync(e, t, n) {
|
|
431
|
+
return this.parse(e, t, _objectSpread2(_objectSpread2({
|
|
432
|
+
throwOnBadSyncType: true
|
|
433
|
+
}, n), {}, {
|
|
434
|
+
sync: true
|
|
435
|
+
}));
|
|
436
|
+
}
|
|
437
|
+
}, {
|
|
438
|
+
key: "parseAsync",
|
|
439
|
+
value: function parseAsync(e, t, n) {
|
|
440
|
+
return this.parse(e, t, _objectSpread2(_objectSpread2({
|
|
441
|
+
throwOnBadSyncType: true
|
|
442
|
+
}, n), {}, {
|
|
443
|
+
sync: false
|
|
444
|
+
}));
|
|
445
|
+
}
|
|
446
|
+
}, {
|
|
447
|
+
key: "specialTypeNames",
|
|
448
|
+
value: function specialTypeNames(e, t) {
|
|
449
|
+
var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
450
|
+
return n.returnTypeNames = true, this.encapsulate(e, t, n);
|
|
451
|
+
}
|
|
452
|
+
}, {
|
|
453
|
+
key: "rootTypeName",
|
|
454
|
+
value: function rootTypeName(e, t) {
|
|
455
|
+
var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
456
|
+
return n.iterateNone = true, this.encapsulate(e, t, n);
|
|
457
|
+
}
|
|
458
|
+
}, {
|
|
459
|
+
key: "encapsulate",
|
|
460
|
+
value: function encapsulate(e, t, i) {
|
|
461
|
+
var _this2 = this;
|
|
462
|
+
var c = _objectSpread2(_objectSpread2({
|
|
546
463
|
sync: true
|
|
547
|
-
}))
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
|
|
562
|
-
return r.returnTypeNames = true, this.encapsulate(e, t, r);
|
|
563
|
-
}
|
|
564
|
-
}, {
|
|
565
|
-
key: "rootTypeName",
|
|
566
|
-
value: function rootTypeName(e, t) {
|
|
567
|
-
var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
|
|
568
|
-
return r.iterateNone = true, this.encapsulate(e, t, r);
|
|
569
|
-
}
|
|
570
|
-
}, {
|
|
571
|
-
key: "encapsulate",
|
|
572
|
-
value: function encapsulate(t, r, c) {
|
|
573
|
-
var s = this,
|
|
574
|
-
u = _objectSpread2(_objectSpread2({
|
|
575
|
-
sync: true
|
|
576
|
-
}, this.options), c),
|
|
577
|
-
y = u.sync,
|
|
578
|
-
l = {},
|
|
579
|
-
p = [],
|
|
580
|
-
f = [],
|
|
581
|
-
v = [],
|
|
582
|
-
h = !("cyclic" in u) || u.cyclic,
|
|
583
|
-
d = u.encapsulateObserver,
|
|
584
|
-
b = function finish(e) {
|
|
585
|
-
var t = Object.values(l);
|
|
586
|
-
if (u.iterateNone) return t.length ? t[0] : getJSONType(e);
|
|
587
|
-
if (t.length) {
|
|
588
|
-
if (u.returnTypeNames) return _toConsumableArray(new Set(t));
|
|
589
|
-
e && isPlainObject(e) && !o(e, "$types") ? e.$types = l : e = {
|
|
590
|
-
$: e,
|
|
591
|
-
$types: {
|
|
592
|
-
$: l
|
|
593
|
-
}
|
|
594
|
-
};
|
|
595
|
-
} else isObject(e) && o(e, "$types") && (e = {
|
|
464
|
+
}, this.options), i),
|
|
465
|
+
a = c.sync,
|
|
466
|
+
p = {},
|
|
467
|
+
y = [],
|
|
468
|
+
u = [],
|
|
469
|
+
l = [],
|
|
470
|
+
h = !("cyclic" in c) || c.cyclic,
|
|
471
|
+
f = c.encapsulateObserver,
|
|
472
|
+
finish = function finish(e) {
|
|
473
|
+
var t = Object.values(p);
|
|
474
|
+
if (c.iterateNone) return t.length ? t[0] : getJSONType(e);
|
|
475
|
+
if (t.length) {
|
|
476
|
+
if (c.returnTypeNames) return _toConsumableArray(new Set(t));
|
|
477
|
+
e && isPlainObject(e) && !r(e, "$types") ? e.$types = p : e = {
|
|
596
478
|
$: e,
|
|
597
|
-
$types:
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
return
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
479
|
+
$types: {
|
|
480
|
+
$: p
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
} else isObject(e) && r(e, "$types") && (e = {
|
|
484
|
+
$: e,
|
|
485
|
+
$types: true
|
|
486
|
+
});
|
|
487
|
+
return !c.returnTypeNames && e;
|
|
488
|
+
},
|
|
489
|
+
_checkPromises = /*#__PURE__*/function () {
|
|
490
|
+
var _checkPromises2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(e, t) {
|
|
491
|
+
var n;
|
|
492
|
+
return _regenerator().w(function (_context2) {
|
|
493
|
+
while (1) switch (_context2.n) {
|
|
494
|
+
case 0:
|
|
495
|
+
_context2.n = 1;
|
|
496
|
+
return Promise.all(t.map(function (e) {
|
|
497
|
+
return e[1].p;
|
|
498
|
+
}));
|
|
499
|
+
case 1:
|
|
500
|
+
n = _context2.v;
|
|
501
|
+
_context2.n = 2;
|
|
502
|
+
return Promise.all(n.map(/*#__PURE__*/function () {
|
|
503
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(n) {
|
|
504
|
+
var r, _t$splice, _t$splice2, s, _s, o, i, c, a, p, y, u, l, _t2;
|
|
505
|
+
return _regenerator().w(function (_context) {
|
|
506
|
+
while (1) switch (_context.n) {
|
|
507
|
+
case 0:
|
|
508
|
+
r = [], _t$splice = t.splice(0, 1), _t$splice2 = _slicedToArray(_t$splice, 1), s = _t$splice2[0], _s = _slicedToArray(s, 7), o = _s[0], i = _s[2], c = _s[3], a = _s[4], p = _s[5], y = _s[6], u = _encapsulate2(o, n, i, c, r, true, y), l = hasConstructorOf(u, TypesonPromise);
|
|
509
|
+
if (!(o && l)) {
|
|
510
|
+
_context.n = 2;
|
|
511
|
+
break;
|
|
512
|
+
}
|
|
513
|
+
_context.n = 1;
|
|
514
|
+
return u.p;
|
|
515
|
+
case 1:
|
|
516
|
+
_t2 = _context.v;
|
|
517
|
+
return _context.a(2, (a[p] = _t2, _checkPromises(e, r)));
|
|
518
|
+
case 2:
|
|
519
|
+
return _context.a(2, (o ? a[p] = u : e = l ? u.p : u, _checkPromises(e, r)));
|
|
520
|
+
}
|
|
521
|
+
}, _callee);
|
|
522
|
+
}));
|
|
523
|
+
return function (_x3) {
|
|
524
|
+
return _ref.apply(this, arguments);
|
|
525
|
+
};
|
|
526
|
+
}()));
|
|
527
|
+
case 2:
|
|
528
|
+
return _context2.a(2, e);
|
|
529
|
+
}
|
|
530
|
+
}, _callee2);
|
|
531
|
+
}));
|
|
532
|
+
function checkPromises(_x, _x2) {
|
|
533
|
+
return _checkPromises2.apply(this, arguments);
|
|
534
|
+
}
|
|
535
|
+
return checkPromises;
|
|
536
|
+
}(),
|
|
537
|
+
_adaptBuiltinStateObjectProperties = function _adaptBuiltinStateObjectProperties(e, t, n) {
|
|
538
|
+
Object.assign(e, t);
|
|
539
|
+
var r = o.map(function (t) {
|
|
540
|
+
var n = e[t];
|
|
541
|
+
return delete e[t], n;
|
|
542
|
+
});
|
|
543
|
+
n(), o.forEach(function (t, n) {
|
|
544
|
+
e[t] = r[n];
|
|
545
|
+
});
|
|
546
|
+
},
|
|
547
|
+
_encapsulate2 = function _encapsulate(e, t, o, i, a, l, h) {
|
|
548
|
+
var d,
|
|
549
|
+
O = {};
|
|
550
|
+
var v = f ? function (n) {
|
|
551
|
+
var _ref2;
|
|
552
|
+
var r = (_ref2 = h !== null && h !== void 0 ? h : i.type) !== null && _ref2 !== void 0 ? _ref2 : getJSONType(t);
|
|
553
|
+
f(Object.assign(n !== null && n !== void 0 ? n : O, {
|
|
554
|
+
keypath: e,
|
|
555
|
+
value: t,
|
|
556
|
+
cyclic: o,
|
|
557
|
+
stateObj: i,
|
|
558
|
+
promisesData: a,
|
|
559
|
+
resolvingTypesonPromise: l,
|
|
560
|
+
awaitingTypesonPromise: hasConstructorOf(t, TypesonPromise)
|
|
561
|
+
}, {
|
|
562
|
+
type: r
|
|
563
|
+
}));
|
|
564
|
+
} : null;
|
|
565
|
+
if (["string", "boolean", "number", "undefined"].includes(_typeof(t))) return void 0 === t || t === 1 / 0 || 0 === t || t === -1 / 0 || Number.isNaN(t) ? (d = i.replaced ? t : replace(e, t, i, a, false, l, v), d !== t && (O = {
|
|
566
|
+
replaced: d
|
|
567
|
+
})) : d = t, v && v(), d;
|
|
568
|
+
if (null === t) return v && v(), t;
|
|
569
|
+
if (o && t && "object" == _typeof(t) && !i.iterateIn && !i.iterateUnsetNumeric) {
|
|
570
|
+
var _n = y.indexOf(t);
|
|
571
|
+
if (-1 !== _n) return p[e] = "#", v && v({
|
|
572
|
+
cyclicKeypath: u[_n]
|
|
573
|
+
}), "#" + u[_n];
|
|
574
|
+
true === o && (y.push(t), u.push(e));
|
|
575
|
+
}
|
|
576
|
+
var m = isPlainObject(t),
|
|
577
|
+
b = s(t),
|
|
578
|
+
P = (m || b) && (!_this2.plainObjectReplacers.length || i.replaced) || i.iterateIn ? t : replace(e, t, i, a, m || b, null, v);
|
|
579
|
+
var T;
|
|
580
|
+
if (P !== t ? (d = P, O = {
|
|
581
|
+
replaced: P
|
|
582
|
+
}) : "" === e && hasConstructorOf(t, TypesonPromise) ? (a.push([e, t, o, i, void 0, void 0, i.type]), d = t) : b && "object" !== i.iterateIn || "array" === i.iterateIn ? (T = new Array(t.length), O = {
|
|
583
|
+
clone: T
|
|
584
|
+
}) : !m && (["function", "symbol"].includes(_typeof(t)) || "toJSON" in t || hasConstructorOf(t, TypesonPromise) || hasConstructorOf(t, Promise) || hasConstructorOf(t, ArrayBuffer)) && "object" !== i.iterateIn ? d = t : (T = {}, i.addLength && (T.length = t.length), O = {
|
|
585
|
+
clone: T
|
|
586
|
+
}), v && v(), c.iterateNone) return T !== null && T !== void 0 ? T : d;
|
|
587
|
+
if (!T) return d;
|
|
588
|
+
if (i.iterateIn) {
|
|
589
|
+
var _loop = function _loop(_n2) {
|
|
590
|
+
var s = {
|
|
591
|
+
ownKeys: r(t, _n2)
|
|
592
|
+
};
|
|
593
|
+
_adaptBuiltinStateObjectProperties(i, s, function () {
|
|
594
|
+
var r = e + (e ? "." : "") + escapeKeyPathComponent(_n2),
|
|
595
|
+
s = _encapsulate2(r, t[_n2], Boolean(o), i, a, l);
|
|
596
|
+
hasConstructorOf(s, TypesonPromise) ? a.push([r, s, Boolean(o), i, T, _n2, i.type]) : void 0 !== s && (T[_n2] = s);
|
|
632
597
|
});
|
|
598
|
+
};
|
|
599
|
+
for (var _n2 in t) {
|
|
600
|
+
_loop(_n2);
|
|
601
|
+
}
|
|
602
|
+
v && v({
|
|
603
|
+
endIterateIn: true,
|
|
604
|
+
end: true
|
|
633
605
|
});
|
|
634
|
-
})
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
r(), a.forEach(function (t, r) {
|
|
642
|
-
e[t] = n[r];
|
|
606
|
+
} else n(t).forEach(function (n) {
|
|
607
|
+
var r = e + (e ? "." : "") + escapeKeyPathComponent(n);
|
|
608
|
+
_adaptBuiltinStateObjectProperties(i, {
|
|
609
|
+
ownKeys: true
|
|
610
|
+
}, function () {
|
|
611
|
+
var e = _encapsulate2(r, t[n], Boolean(o), i, a, l);
|
|
612
|
+
hasConstructorOf(e, TypesonPromise) ? a.push([r, e, Boolean(o), i, T, n, i.type]) : void 0 !== e && (T[n] = e);
|
|
643
613
|
});
|
|
644
|
-
},
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
cyclic: a,
|
|
656
|
-
stateObj: c,
|
|
657
|
-
promisesData: y,
|
|
658
|
-
resolvingTypesonPromise: v,
|
|
659
|
-
awaitingTypesonPromise: hasConstructorOf(r, e)
|
|
660
|
-
}, {
|
|
661
|
-
type: i
|
|
662
|
-
}));
|
|
663
|
-
} : null;
|
|
664
|
-
if (["string", "boolean", "number", "undefined"].includes(g)) return void 0 === r || Number.isNaN(r) || r === Number.NEGATIVE_INFINITY || r === Number.POSITIVE_INFINITY || 0 === r ? (b = c.replaced ? r : j(t, r, c, y, false, v, S)) !== r && (_ = {
|
|
665
|
-
replaced: b
|
|
666
|
-
}) : b = r, S && S(), b;
|
|
667
|
-
if (null === r) return S && S(), r;
|
|
668
|
-
if (a && !c.iterateIn && !c.iterateUnsetNumeric && r && "object" === _typeof(r)) {
|
|
669
|
-
var w = p.indexOf(r);
|
|
670
|
-
if (-1 !== w) return l[t] = "#", S && S({
|
|
671
|
-
cyclicKeypath: f[w]
|
|
672
|
-
}), "#" + f[w];
|
|
673
|
-
true === a && (p.push(r), f.push(t));
|
|
674
|
-
}
|
|
675
|
-
var T,
|
|
676
|
-
P = isPlainObject(r),
|
|
677
|
-
A = i$1(r),
|
|
678
|
-
C = (P || A) && (!s.plainObjectReplacers.length || c.replaced) || c.iterateIn ? r : j(t, r, c, y, P || A, null, S);
|
|
679
|
-
if (C !== r ? (b = C, _ = {
|
|
680
|
-
replaced: C
|
|
681
|
-
}) : "" === t && hasConstructorOf(r, e) ? (y.push([t, r, a, c, void 0, void 0, c.type]), b = r) : A && "object" !== c.iterateIn || "array" === c.iterateIn ? (T = new Array(r.length), _ = {
|
|
682
|
-
clone: T
|
|
683
|
-
}) : (["function", "symbol"].includes(_typeof(r)) || "toJSON" in r || hasConstructorOf(r, e) || hasConstructorOf(r, Promise) || hasConstructorOf(r, ArrayBuffer)) && !P && "object" !== c.iterateIn ? b = r : (T = {}, c.addLength && (T.length = r.length), _ = {
|
|
684
|
-
clone: T
|
|
685
|
-
}), S && S(), u.iterateNone) return null != T ? T : b;
|
|
686
|
-
if (!T) return b;
|
|
687
|
-
if (c.iterateIn) {
|
|
688
|
-
var k = function _loop(n) {
|
|
689
|
-
var i = {
|
|
690
|
-
ownKeys: o(r, n)
|
|
691
|
-
};
|
|
692
|
-
O(c, i, function () {
|
|
693
|
-
var o = t + (t ? "." : "") + escapeKeyPathComponent(n),
|
|
694
|
-
i = m(o, r[n], Boolean(a), c, y, v);
|
|
695
|
-
hasConstructorOf(i, e) ? y.push([o, i, Boolean(a), c, T, n, c.type]) : void 0 !== i && (T[n] = i);
|
|
696
|
-
});
|
|
697
|
-
};
|
|
698
|
-
for (var N in r) k(N);
|
|
699
|
-
S && S({
|
|
700
|
-
endIterateIn: true,
|
|
701
|
-
end: true
|
|
702
|
-
});
|
|
703
|
-
} else n(r).forEach(function (n) {
|
|
704
|
-
var o = t + (t ? "." : "") + escapeKeyPathComponent(n);
|
|
705
|
-
O(c, {
|
|
706
|
-
ownKeys: true
|
|
614
|
+
}), v && v({
|
|
615
|
+
endIterateOwn: true,
|
|
616
|
+
end: true
|
|
617
|
+
});
|
|
618
|
+
if (i.iterateUnsetNumeric) {
|
|
619
|
+
var _n3 = t.length;
|
|
620
|
+
var _loop2 = function _loop2(_r2) {
|
|
621
|
+
if (_r2 in t) return 1; // continue
|
|
622
|
+
var n = "".concat(e).concat(e ? "." : "").concat(String(_r2));
|
|
623
|
+
_adaptBuiltinStateObjectProperties(i, {
|
|
624
|
+
ownKeys: false
|
|
707
625
|
}, function () {
|
|
708
|
-
var
|
|
709
|
-
hasConstructorOf(
|
|
626
|
+
var e = _encapsulate2(n, void 0, Boolean(o), i, a, l);
|
|
627
|
+
hasConstructorOf(e, TypesonPromise) ? a.push([n, e, Boolean(o), i, T, _r2, i.type]) : void 0 !== e && (T[_r2] = e);
|
|
710
628
|
});
|
|
711
|
-
}
|
|
712
|
-
|
|
629
|
+
};
|
|
630
|
+
for (var _r2 = 0; _r2 < _n3; _r2++) {
|
|
631
|
+
if (_loop2(_r2)) continue;
|
|
632
|
+
}
|
|
633
|
+
v && v({
|
|
634
|
+
endIterateUnsetNumeric: true,
|
|
713
635
|
end: true
|
|
714
636
|
});
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
endIterateUnsetNumeric: true,
|
|
729
|
-
end: true
|
|
730
|
-
});
|
|
731
|
-
}
|
|
732
|
-
return T;
|
|
733
|
-
},
|
|
734
|
-
j = function replace(e, t, r, n, o, i, a) {
|
|
735
|
-
for (var c = o ? s.plainObjectReplacers : s.nonplainObjectReplacers, u = c.length; u--;) {
|
|
736
|
-
var p = c[u];
|
|
737
|
-
if (p.test(t, r)) {
|
|
738
|
-
var f = p.type;
|
|
739
|
-
if (s.revivers[f]) {
|
|
740
|
-
var v = l[e];
|
|
741
|
-
l[e] = v ? [f].concat(v) : f;
|
|
742
|
-
}
|
|
743
|
-
if (Object.assign(r, {
|
|
744
|
-
type: f,
|
|
745
|
-
replaced: true
|
|
746
|
-
}), (y || !p.replaceAsync) && !p.replace) return a && a({
|
|
747
|
-
typeDetected: true
|
|
748
|
-
}), m(e, t, h && "readonly", r, n, i, f);
|
|
749
|
-
a && a({
|
|
750
|
-
replacing: true
|
|
751
|
-
});
|
|
752
|
-
var d = void 0;
|
|
753
|
-
if (y || !p.replaceAsync) {
|
|
754
|
-
if (void 0 === p.replace) throw new TypeError("Missing replacer");
|
|
755
|
-
d = p.replace(t, r);
|
|
756
|
-
} else d = p.replaceAsync(t, r);
|
|
757
|
-
return m(e, d, h && "readonly", r, n, i, f);
|
|
637
|
+
}
|
|
638
|
+
return T;
|
|
639
|
+
},
|
|
640
|
+
replace = function replace(e, t, n, r, s, o, i) {
|
|
641
|
+
var c = s ? _this2.plainObjectReplacers : _this2.nonplainObjectReplacers;
|
|
642
|
+
var y = c.length;
|
|
643
|
+
for (; y--;) {
|
|
644
|
+
var _s2 = c[y];
|
|
645
|
+
if (_s2.test(t, n)) {
|
|
646
|
+
var _c = _s2.type;
|
|
647
|
+
if (Object.hasOwn(_this2.revivers, _c)) {
|
|
648
|
+
var _t3 = p[e];
|
|
649
|
+
p[e] = _t3 ? [_c].concat(_t3) : _c;
|
|
758
650
|
}
|
|
651
|
+
if (Object.assign(n, {
|
|
652
|
+
type: _c,
|
|
653
|
+
replaced: true
|
|
654
|
+
}), (a || !_s2.replaceAsync) && !_s2.replace) return i && i({
|
|
655
|
+
typeDetected: true
|
|
656
|
+
}), _encapsulate2(e, t, h && "readonly", n, r, o, _c);
|
|
657
|
+
var _y = void 0;
|
|
658
|
+
if (i && i({
|
|
659
|
+
replacing: true
|
|
660
|
+
}), a || !_s2.replaceAsync) {
|
|
661
|
+
if (void 0 === _s2.replace) throw new TypeError("Missing replacer");
|
|
662
|
+
_y = _s2.replace(t, n);
|
|
663
|
+
} else _y = _s2.replaceAsync(t, n);
|
|
664
|
+
return _encapsulate2(e, _y, h && "readonly", n, r, o, _c);
|
|
759
665
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
666
|
+
}
|
|
667
|
+
return t;
|
|
668
|
+
},
|
|
669
|
+
d = _encapsulate2("", e, h, t !== null && t !== void 0 ? t : {}, l);
|
|
670
|
+
if (l.length) return a && c.throwOnBadSyncType ? function () {
|
|
671
|
+
throw new TypeError("Sync method requested but async result obtained");
|
|
672
|
+
}() : Promise.resolve(_checkPromises(d, l)).then(finish);
|
|
673
|
+
if (!a && c.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
|
|
674
|
+
return a && c.stringification ? [finish(d)] : a ? finish(d) : Promise.resolve(finish(d));
|
|
675
|
+
}
|
|
676
|
+
}, {
|
|
677
|
+
key: "encapsulateSync",
|
|
678
|
+
value: function encapsulateSync(e, t, n) {
|
|
679
|
+
return this.encapsulate(e, t, _objectSpread2(_objectSpread2({
|
|
680
|
+
throwOnBadSyncType: true
|
|
681
|
+
}, n), {}, {
|
|
682
|
+
sync: true
|
|
683
|
+
}));
|
|
684
|
+
}
|
|
685
|
+
}, {
|
|
686
|
+
key: "encapsulateAsync",
|
|
687
|
+
value: function encapsulateAsync(e, t, n) {
|
|
688
|
+
return this.encapsulate(e, t, _objectSpread2(_objectSpread2({
|
|
689
|
+
throwOnBadSyncType: true
|
|
690
|
+
}, n), {}, {
|
|
691
|
+
sync: false
|
|
692
|
+
}));
|
|
693
|
+
}
|
|
694
|
+
}, {
|
|
695
|
+
key: "revive",
|
|
696
|
+
value: function revive(e, t) {
|
|
697
|
+
var _this3 = this;
|
|
698
|
+
var o = _objectSpread2(_objectSpread2({
|
|
775
699
|
sync: true
|
|
776
|
-
}))
|
|
700
|
+
}, this.options), t),
|
|
701
|
+
i = o.sync;
|
|
702
|
+
function finishRevival(e) {
|
|
703
|
+
if (i) return e;
|
|
704
|
+
if (o.throwOnBadSyncType) throw new TypeError("Async method requested but sync result obtained");
|
|
705
|
+
return Promise.resolve(e);
|
|
777
706
|
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
707
|
+
if (!e || "object" != _typeof(e) || Array.isArray(e)) return finishRevival(e);
|
|
708
|
+
var c = e.$types;
|
|
709
|
+
if (true === c) return finishRevival(e.$);
|
|
710
|
+
if (!c || "object" != _typeof(c) || Array.isArray(c)) return finishRevival(e);
|
|
711
|
+
var a = [],
|
|
712
|
+
p = Object.create(null),
|
|
713
|
+
y = {};
|
|
714
|
+
var u = true;
|
|
715
|
+
c.$ && isPlainObject(c.$) && (e = e.$, c = c.$, u = false);
|
|
716
|
+
var executeReviver = function executeReviver(e, t) {
|
|
717
|
+
var _this3$revivers$e;
|
|
718
|
+
var _ref3 = (_this3$revivers$e = _this3.revivers[e]) !== null && _this3$revivers$e !== void 0 ? _this3$revivers$e : [],
|
|
719
|
+
_ref4 = _slicedToArray(_ref3, 1),
|
|
720
|
+
n = _ref4[0];
|
|
721
|
+
if (!n) throw new Error("Unregistered type: " + e);
|
|
722
|
+
if (i && !("revive" in n)) return t;
|
|
723
|
+
if (!i && n.reviveAsync) return n.reviveAsync(t, y);
|
|
724
|
+
if (n.revive) return n.revive(t, y);
|
|
725
|
+
throw new Error("Missing reviver");
|
|
726
|
+
},
|
|
727
|
+
l = [];
|
|
728
|
+
function checkUndefined(e) {
|
|
729
|
+
return hasConstructorOf(e, Undefined) ? void 0 : e;
|
|
786
730
|
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
731
|
+
var h = function () {
|
|
732
|
+
if (!c) throw new Error("Found bad `types`");
|
|
733
|
+
var t = [];
|
|
734
|
+
if (Object.entries(c).forEach(function (_ref5) {
|
|
735
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
736
|
+
e = _ref6[0],
|
|
737
|
+
n = _ref6[1];
|
|
738
|
+
"#" !== n && [].concat(n).forEach(function (n) {
|
|
739
|
+
var _this3$revivers$n;
|
|
740
|
+
var _ref7 = (_this3$revivers$n = _this3.revivers[n]) !== null && _this3$revivers$n !== void 0 ? _this3$revivers$n : [null, {}],
|
|
741
|
+
_ref8 = _slicedToArray(_ref7, 2),
|
|
742
|
+
r = _ref8[1].plain;
|
|
743
|
+
r && (t.push({
|
|
744
|
+
keypath: e,
|
|
745
|
+
type: n
|
|
746
|
+
}), delete c[e]);
|
|
747
|
+
});
|
|
748
|
+
}), t.length) return t.sort(nestedPathsFirst), t.reduce(function reducer(t, _ref9) {
|
|
749
|
+
var n = _ref9.keypath,
|
|
750
|
+
r = _ref9.type;
|
|
751
|
+
if (isThenable(t)) return t.then(function (e) {
|
|
752
|
+
return reducer(e, {
|
|
753
|
+
keypath: n,
|
|
754
|
+
type: r
|
|
755
|
+
});
|
|
756
|
+
});
|
|
757
|
+
var s = getByKeyPath(e, n);
|
|
758
|
+
if (s = executeReviver(r, s), hasConstructorOf(s, TypesonPromise)) return s.then(function (t) {
|
|
759
|
+
var r = setAtKeyPath(e, n, t);
|
|
760
|
+
r === t && (e = r);
|
|
761
|
+
});
|
|
762
|
+
var o = setAtKeyPath(e, n, s);
|
|
763
|
+
o === s && (e = o);
|
|
764
|
+
}, void 0);
|
|
765
|
+
}();
|
|
766
|
+
var f;
|
|
767
|
+
return hasConstructorOf(h, TypesonPromise) ? f = h.then(function () {
|
|
768
|
+
return e;
|
|
769
|
+
}) : (f = function _revive(e, t, o, y, h) {
|
|
770
|
+
if (u && "$types" === e) return;
|
|
771
|
+
var f = l.length,
|
|
772
|
+
d = c[e],
|
|
773
|
+
O = s(t);
|
|
774
|
+
if (O || isPlainObject(t)) {
|
|
775
|
+
var _s3 = O ? new Array(t.length) : {};
|
|
776
|
+
for (n(t).forEach(function (n) {
|
|
777
|
+
var r = _revive(e + (e ? "." : "") + escapeKeyPathComponent(n), t[n], o !== null && o !== void 0 ? o : _s3, _s3, n),
|
|
778
|
+
set = function set(e) {
|
|
779
|
+
return hasConstructorOf(e, Undefined) ? _s3[n] = void 0 : void 0 !== e && (_s3[n] = e), e;
|
|
780
|
+
};
|
|
781
|
+
hasConstructorOf(r, TypesonPromise) ? l.push(r.then(function (e) {
|
|
782
|
+
return set(e);
|
|
783
|
+
})) : set(r);
|
|
784
|
+
}), t = _s3; a.length;) {
|
|
785
|
+
var _a$ = _slicedToArray(a[0], 4),
|
|
786
|
+
_e = _a$[0],
|
|
787
|
+
_t4 = _a$[1],
|
|
788
|
+
_n4 = _a$[2],
|
|
789
|
+
_s4 = _a$[3],
|
|
790
|
+
_o = r(p, _t4),
|
|
791
|
+
_i = _o ? p[_t4] : getByKeyPath(_e, _t4);
|
|
792
|
+
if (!_o && void 0 === _i) break;
|
|
793
|
+
_n4[_s4] = _i, a.shift();
|
|
794
|
+
}
|
|
799
795
|
}
|
|
800
|
-
if (!
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
p = true;
|
|
807
|
-
u.$ && isPlainObject(u.$) && (t = t.$, u = u.$, p = false);
|
|
808
|
-
var f = function executeReviver(e, t) {
|
|
809
|
-
var r,
|
|
810
|
-
n = _slicedToArray(null !== (r = o.revivers[e]) && void 0 !== r ? r : [], 1)[0];
|
|
811
|
-
if (!n) throw new Error("Unregistered type: " + e);
|
|
812
|
-
if (c && !("revive" in n)) return t;
|
|
813
|
-
if (!c && n.reviveAsync) return n.reviveAsync(t, l);
|
|
814
|
-
if (n.revive) return n.revive(t, l);
|
|
815
|
-
throw new Error("Missing reviver");
|
|
816
|
-
},
|
|
817
|
-
v = [];
|
|
818
|
-
function checkUndefined(e) {
|
|
819
|
-
return hasConstructorOf(e, s) ? void 0 : e;
|
|
796
|
+
if (!d) return p[e] = t, t;
|
|
797
|
+
if ("#" === d) {
|
|
798
|
+
var _e2 = t.slice(1),
|
|
799
|
+
_n5 = r(p, _e2),
|
|
800
|
+
_s5 = _n5 ? p[_e2] : getByKeyPath(o, _e2);
|
|
801
|
+
return _n5 || void 0 !== _s5 || a.push([o, _e2, y, h]), _s5;
|
|
820
802
|
}
|
|
821
|
-
var
|
|
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
|
-
|
|
803
|
+
var applyType = function applyType(t) {
|
|
804
|
+
var n = [].concat(d).reduce(function reducer(e, t) {
|
|
805
|
+
if (hasConstructorOf(e, TypesonPromise)) return e.then(function (e) {
|
|
806
|
+
return reducer(e, t);
|
|
807
|
+
});
|
|
808
|
+
if ("string" != typeof t) throw new TypeError("Bad type JSON");
|
|
809
|
+
return executeReviver(t, e);
|
|
810
|
+
}, t);
|
|
811
|
+
return hasConstructorOf(n, TypesonPromise) ? n.then(function (t) {
|
|
812
|
+
return p[e] = t, t;
|
|
813
|
+
}) : (p[e] = n, n);
|
|
814
|
+
};
|
|
815
|
+
return !i && l.length > f ? TypesonPromise.all(l.slice(f)).then(function () {
|
|
816
|
+
return applyType(t);
|
|
817
|
+
}) : applyType(t);
|
|
818
|
+
}("", e, null), l.length && (f = TypesonPromise.resolve(f).then(function (e) {
|
|
819
|
+
return TypesonPromise.all([e].concat(l));
|
|
820
|
+
}).then(function (_ref0) {
|
|
821
|
+
var _ref1 = _slicedToArray(_ref0, 1),
|
|
822
|
+
e = _ref1[0];
|
|
823
|
+
return e;
|
|
824
|
+
}))), isThenable(f) ? i && o.throwOnBadSyncType ? function () {
|
|
825
|
+
throw new TypeError("Sync method requested but async result obtained");
|
|
826
|
+
}() : hasConstructorOf(f, TypesonPromise) ? f.p.then(checkUndefined) : f : !i && o.throwOnBadSyncType ? function () {
|
|
827
|
+
throw new TypeError("Async method requested but sync result obtained");
|
|
828
|
+
}() : i ? checkUndefined(f) : Promise.resolve(checkUndefined(f));
|
|
829
|
+
}
|
|
830
|
+
}, {
|
|
831
|
+
key: "reviveSync",
|
|
832
|
+
value: function reviveSync(e, t) {
|
|
833
|
+
return this.revive(e, _objectSpread2(_objectSpread2({
|
|
834
|
+
throwOnBadSyncType: true
|
|
835
|
+
}, t), {}, {
|
|
836
|
+
sync: true
|
|
837
|
+
}));
|
|
838
|
+
}
|
|
839
|
+
}, {
|
|
840
|
+
key: "reviveAsync",
|
|
841
|
+
value: function reviveAsync(e, t) {
|
|
842
|
+
return this.revive(e, _objectSpread2(_objectSpread2({
|
|
843
|
+
throwOnBadSyncType: true
|
|
844
|
+
}, t), {}, {
|
|
845
|
+
sync: false
|
|
846
|
+
}));
|
|
847
|
+
}
|
|
848
|
+
}, {
|
|
849
|
+
key: "register",
|
|
850
|
+
value: function register(e, t) {
|
|
851
|
+
var _this4 = this;
|
|
852
|
+
var r = t !== null && t !== void 0 ? t : {},
|
|
853
|
+
_reg = function reg(e) {
|
|
854
|
+
s(e) ? e.forEach(function (e) {
|
|
855
|
+
_reg(e);
|
|
856
|
+
}) : n(e).forEach(function (t) {
|
|
857
|
+
var _n8;
|
|
858
|
+
if ("#" === t) throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");
|
|
859
|
+
if (i$1.includes(t)) throw new TypeError("Plain JSON object types are reserved as type names");
|
|
860
|
+
var n = e[t];
|
|
861
|
+
var o = n && "function" != typeof n && !Array.isArray(n) && n.testPlainObjects ? _this4.plainObjectReplacers : _this4.nonplainObjectReplacers,
|
|
862
|
+
c = o.filter(function (e) {
|
|
863
|
+
return e.type === t;
|
|
849
864
|
});
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
m = b[2],
|
|
875
|
-
j = b[3],
|
|
876
|
-
g = getByKeyPath(_, O);
|
|
877
|
-
if (void 0 === g) break;
|
|
878
|
-
m[j] = g, y.splice(0, 1);
|
|
879
|
-
}
|
|
865
|
+
if (c.length && (o.splice(o.indexOf(c[0]), 1), delete _this4.revivers[t], delete _this4.types[t]), "function" == typeof n) {
|
|
866
|
+
var _e3 = n;
|
|
867
|
+
n = {
|
|
868
|
+
test: function test(t) {
|
|
869
|
+
return t && t.constructor === _e3;
|
|
870
|
+
},
|
|
871
|
+
replace: function replace(e) {
|
|
872
|
+
return _objectSpread2({}, e);
|
|
873
|
+
},
|
|
874
|
+
revive: function revive(t) {
|
|
875
|
+
return Object.assign(Object.create(_e3.prototype), t);
|
|
876
|
+
}
|
|
877
|
+
};
|
|
878
|
+
} else if (s(n)) {
|
|
879
|
+
var _n6 = n,
|
|
880
|
+
_n7 = _slicedToArray(_n6, 3),
|
|
881
|
+
_e4 = _n7[0],
|
|
882
|
+
_t5 = _n7[1],
|
|
883
|
+
_r3 = _n7[2];
|
|
884
|
+
n = {
|
|
885
|
+
test: _e4,
|
|
886
|
+
replace: _t5,
|
|
887
|
+
revive: _r3
|
|
888
|
+
};
|
|
880
889
|
}
|
|
881
|
-
if (!
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
890
|
+
if (!((_n8 = n) !== null && _n8 !== void 0 && _n8.test)) return;
|
|
891
|
+
var a = {
|
|
892
|
+
type: t,
|
|
893
|
+
test: n.test.bind(n)
|
|
894
|
+
};
|
|
895
|
+
n.replace && (a.replace = n.replace.bind(n)), n.replaceAsync && (a.replaceAsync = n.replaceAsync.bind(n));
|
|
896
|
+
var p = "number" == typeof r.fallback ? r.fallback : r.fallback ? 0 : 1 / 0;
|
|
897
|
+
if (n.testPlainObjects ? _this4.plainObjectReplacers.splice(p, 0, a) : _this4.nonplainObjectReplacers.splice(p, 0, a), n.revive || n.reviveAsync) {
|
|
898
|
+
var _e5 = {};
|
|
899
|
+
n.revive && (_e5.revive = n.revive.bind(n)), n.reviveAsync && (_e5.reviveAsync = n.reviveAsync.bind(n)), _this4.revivers[t] = [_e5, {
|
|
900
|
+
plain: n.testPlainObjects
|
|
901
|
+
}];
|
|
885
902
|
}
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
}() : hasConstructorOf(h, e) ? h.p.then(checkUndefined) : h : !c && a.throwOnBadSyncType ? function () {
|
|
901
|
-
throw new TypeError("Async method requested but sync result obtained");
|
|
902
|
-
}() : c ? checkUndefined(h) : Promise.resolve(checkUndefined(h));
|
|
903
|
-
}
|
|
904
|
-
}, {
|
|
905
|
-
key: "reviveSync",
|
|
906
|
-
value: function reviveSync(e, t) {
|
|
907
|
-
return this.revive(e, _objectSpread2(_objectSpread2({
|
|
908
|
-
throwOnBadSyncType: true
|
|
909
|
-
}, t), {}, {
|
|
910
|
-
sync: true
|
|
911
|
-
}));
|
|
912
|
-
}
|
|
913
|
-
}, {
|
|
914
|
-
key: "reviveAsync",
|
|
915
|
-
value: function reviveAsync(e, t) {
|
|
916
|
-
return this.revive(e, _objectSpread2(_objectSpread2({
|
|
917
|
-
throwOnBadSyncType: true
|
|
918
|
-
}, t), {}, {
|
|
919
|
-
sync: false
|
|
920
|
-
}));
|
|
921
|
-
}
|
|
922
|
-
}, {
|
|
923
|
-
key: "register",
|
|
924
|
-
value: function register(e, t) {
|
|
925
|
-
var r = this,
|
|
926
|
-
o = null != t ? t : {},
|
|
927
|
-
a = function reg(e) {
|
|
928
|
-
i$1(e) ? e.forEach(function (e) {
|
|
929
|
-
a(e);
|
|
930
|
-
}) : n(e).forEach(function (t) {
|
|
931
|
-
var n;
|
|
932
|
-
if ("#" === t) throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");
|
|
933
|
-
if (u.includes(t)) throw new TypeError("Plain JSON object types are reserved as type names");
|
|
934
|
-
var a = e[t],
|
|
935
|
-
c = a && "function" != typeof a && !Array.isArray(a) && a.testPlainObjects ? r.plainObjectReplacers : r.nonplainObjectReplacers,
|
|
936
|
-
s = c.filter(function (e) {
|
|
937
|
-
return e.type === t;
|
|
938
|
-
});
|
|
939
|
-
if (s.length && (c.splice(c.indexOf(s[0]), 1), delete r.revivers[t], delete r.types[t]), "function" == typeof a) {
|
|
940
|
-
var y = a;
|
|
941
|
-
a = {
|
|
942
|
-
test: function test(e) {
|
|
943
|
-
return e && e.constructor === y;
|
|
944
|
-
},
|
|
945
|
-
replace: function replace(e) {
|
|
946
|
-
return _objectSpread2({}, e);
|
|
947
|
-
},
|
|
948
|
-
revive: function revive(e) {
|
|
949
|
-
return Object.assign(Object.create(y.prototype), e);
|
|
950
|
-
}
|
|
951
|
-
};
|
|
952
|
-
} else if (i$1(a)) {
|
|
953
|
-
var l = _slicedToArray(a, 3);
|
|
954
|
-
a = {
|
|
955
|
-
test: l[0],
|
|
956
|
-
replace: l[1],
|
|
957
|
-
revive: l[2]
|
|
958
|
-
};
|
|
959
|
-
}
|
|
960
|
-
if (null !== (n = a) && void 0 !== n && n.test) {
|
|
961
|
-
var p = {
|
|
962
|
-
type: t,
|
|
963
|
-
test: a.test.bind(a)
|
|
964
|
-
};
|
|
965
|
-
a.replace && (p.replace = a.replace.bind(a)), a.replaceAsync && (p.replaceAsync = a.replaceAsync.bind(a));
|
|
966
|
-
var f = "number" == typeof o.fallback ? o.fallback : o.fallback ? 0 : Number.POSITIVE_INFINITY;
|
|
967
|
-
if (a.testPlainObjects ? r.plainObjectReplacers.splice(f, 0, p) : r.nonplainObjectReplacers.splice(f, 0, p), a.revive || a.reviveAsync) {
|
|
968
|
-
var v = {};
|
|
969
|
-
a.revive && (v.revive = a.revive.bind(a)), a.reviveAsync && (v.reviveAsync = a.reviveAsync.bind(a)), r.revivers[t] = [v, {
|
|
970
|
-
plain: a.testPlainObjects
|
|
971
|
-
}];
|
|
972
|
-
}
|
|
973
|
-
r.types[t] = a;
|
|
974
|
-
}
|
|
975
|
-
});
|
|
976
|
-
};
|
|
977
|
-
return [].concat(e).forEach(function (e) {
|
|
978
|
-
a(e);
|
|
979
|
-
}), this;
|
|
980
|
-
}
|
|
981
|
-
}]);
|
|
982
|
-
}(),
|
|
983
|
-
s = _createClass(function Undefined() {
|
|
984
|
-
_classCallCheck(this, Undefined);
|
|
985
|
-
});
|
|
986
|
-
s.__typeson__type__ = "TypesonUndefined";
|
|
987
|
-
var u = ["null", "boolean", "number", "string", "array", "object"];
|
|
903
|
+
_this4.types[t] = n;
|
|
904
|
+
});
|
|
905
|
+
};
|
|
906
|
+
return [].concat(e).forEach(function (e) {
|
|
907
|
+
_reg(e);
|
|
908
|
+
}), this;
|
|
909
|
+
}
|
|
910
|
+
}]);
|
|
911
|
+
}();
|
|
912
|
+
var Undefined = /*#__PURE__*/_createClass(function Undefined() {
|
|
913
|
+
_classCallCheck(this, Undefined);
|
|
914
|
+
});
|
|
915
|
+
Undefined.__typeson__type__ = "TypesonUndefined";
|
|
916
|
+
var i$1 = ["null", "boolean", "number", "string", "array", "object"];
|
|
988
917
|
|
|
989
918
|
/*
|
|
990
919
|
* base64-arraybuffer
|
|
@@ -1137,7 +1066,7 @@
|
|
|
1137
1066
|
var bigintObject = {
|
|
1138
1067
|
bigintObject: {
|
|
1139
1068
|
test: function test(x) {
|
|
1140
|
-
return _typeof
|
|
1069
|
+
return _typeof(x) === 'object' && hasConstructorOf(x, BigInt);
|
|
1141
1070
|
},
|
|
1142
1071
|
replace: String,
|
|
1143
1072
|
revive: function revive(s) {
|
|
@@ -1269,7 +1198,7 @@
|
|
|
1269
1198
|
});
|
|
1270
1199
|
},
|
|
1271
1200
|
replaceAsync: function replaceAsync(b) {
|
|
1272
|
-
return new
|
|
1201
|
+
return new TypesonPromise(function (resolve, reject) {
|
|
1273
1202
|
/*
|
|
1274
1203
|
if (b.isClosed) { // On MDN, but not in https://w3c.github.io/FileAPI/#dfn-Blob
|
|
1275
1204
|
reject(new Error('The Blob is closed'));
|
|
@@ -1304,7 +1233,7 @@
|
|
|
1304
1233
|
* @returns {string}
|
|
1305
1234
|
*/
|
|
1306
1235
|
function generateUUID() {
|
|
1307
|
-
// Adapted from original: public domain/MIT:
|
|
1236
|
+
// Adapted from original: public domain/MIT: https://stackoverflow.com/a/8809472/271577
|
|
1308
1237
|
/* c8 ignore next */
|
|
1309
1238
|
var d = Date.now();
|
|
1310
1239
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replaceAll(/[xy]/g, function (c) {
|
|
@@ -1327,7 +1256,7 @@
|
|
|
1327
1256
|
var cloneable = {
|
|
1328
1257
|
cloneable: {
|
|
1329
1258
|
test: function test(x) {
|
|
1330
|
-
return x && _typeof
|
|
1259
|
+
return x && _typeof(x) === 'object' && typeof x[Symbol["for"]('cloneEncapsulate')] === 'function';
|
|
1331
1260
|
},
|
|
1332
1261
|
replace: function replace(clonable) {
|
|
1333
1262
|
var encapsulated = clonable[Symbol["for"]('cloneEncapsulate')]();
|
|
@@ -1356,7 +1285,7 @@
|
|
|
1356
1285
|
},
|
|
1357
1286
|
replaceAsync: function replaceAsync(/** @type {CryptoKey} */
|
|
1358
1287
|
key) {
|
|
1359
|
-
return new
|
|
1288
|
+
return new TypesonPromise(/*#__PURE__*/function () {
|
|
1360
1289
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(resolve, reject) {
|
|
1361
1290
|
var jwk, _t;
|
|
1362
1291
|
return _regenerator().w(function (_context) {
|
|
@@ -1508,7 +1437,7 @@
|
|
|
1508
1437
|
},
|
|
1509
1438
|
revive: function revive(time) {
|
|
1510
1439
|
if (time === 'NaN') {
|
|
1511
|
-
return new Date(
|
|
1440
|
+
return new Date(NaN);
|
|
1512
1441
|
}
|
|
1513
1442
|
return new Date(time);
|
|
1514
1443
|
}
|
|
@@ -1756,9 +1685,11 @@
|
|
|
1756
1685
|
* }}
|
|
1757
1686
|
*/
|
|
1758
1687
|
new Error(obj.message);
|
|
1688
|
+
/* eslint-disable unicorn/no-error-property-assignment -- Ok */
|
|
1759
1689
|
e.name = obj.name;
|
|
1760
1690
|
e.cause = obj.cause;
|
|
1761
1691
|
e.stack = obj.stack;
|
|
1692
|
+
/* eslint-enable unicorn/no-error-property-assignment -- Ok */
|
|
1762
1693
|
e.fileName = obj.fileName;
|
|
1763
1694
|
e.lineNumber = obj.lineNumber;
|
|
1764
1695
|
e.columnNumber = obj.columnNumber;
|
|
@@ -1775,6 +1706,7 @@
|
|
|
1775
1706
|
var errors = {};
|
|
1776
1707
|
|
|
1777
1708
|
// JS standard
|
|
1709
|
+
// eslint-disable-next-line unicorn/no-top-level-side-effects -- Too cumbersome
|
|
1778
1710
|
[TypeError, RangeError, SyntaxError, ReferenceError, EvalError, URIError].forEach(function (error) {
|
|
1779
1711
|
return create$2(error);
|
|
1780
1712
|
});
|
|
@@ -1791,7 +1723,6 @@
|
|
|
1791
1723
|
create$2(InternalError);
|
|
1792
1724
|
}
|
|
1793
1725
|
|
|
1794
|
-
/* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131 */
|
|
1795
1726
|
/**
|
|
1796
1727
|
* Non-standard.
|
|
1797
1728
|
* @typedef {{
|
|
@@ -1799,7 +1730,6 @@
|
|
|
1799
1730
|
* (message?: string, options?: ErrorOptions): EvalError;
|
|
1800
1731
|
* }} InternalErrorConstructor
|
|
1801
1732
|
*/
|
|
1802
|
-
/* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/131 */
|
|
1803
1733
|
|
|
1804
1734
|
/**
|
|
1805
1735
|
* Comprises all built-in errors.
|
|
@@ -1908,7 +1838,7 @@
|
|
|
1908
1838
|
});
|
|
1909
1839
|
},
|
|
1910
1840
|
replaceAsync: function replaceAsync(f) {
|
|
1911
|
-
return new
|
|
1841
|
+
return new TypesonPromise(function (resolve, reject) {
|
|
1912
1842
|
/*
|
|
1913
1843
|
if (f.isClosed) { // On MDN, but not in https://w3c.github.io/FileAPI/#dfn-Blob
|
|
1914
1844
|
reject(new Error('The File is closed'));
|
|
@@ -1962,7 +1892,7 @@
|
|
|
1962
1892
|
* Set private properties and length.
|
|
1963
1893
|
*/
|
|
1964
1894
|
function FileList() {
|
|
1965
|
-
_classCallCheck
|
|
1895
|
+
_classCallCheck(this, FileList);
|
|
1966
1896
|
// eslint-disable-next-line prefer-rest-params -- API
|
|
1967
1897
|
this._files = arguments[0];
|
|
1968
1898
|
this.length = this._files.length;
|
|
@@ -1971,7 +1901,7 @@
|
|
|
1971
1901
|
* @param {import('typeson').Integer} index
|
|
1972
1902
|
* @returns {File}
|
|
1973
1903
|
*/
|
|
1974
|
-
return _createClass
|
|
1904
|
+
return _createClass(FileList, [{
|
|
1975
1905
|
key: "item",
|
|
1976
1906
|
value: function item(index) {
|
|
1977
1907
|
return this._files[index];
|
|
@@ -2030,7 +1960,7 @@
|
|
|
2030
1960
|
var ctx = /** @type {CanvasRenderingContext2D} */
|
|
2031
1961
|
canvas.getContext('2d');
|
|
2032
1962
|
var img = document.createElement('img');
|
|
2033
|
-
// The onload is needed by some browsers per
|
|
1963
|
+
// The onload is needed by some browsers per https://stackoverflow.com/a/4776378/271577
|
|
2034
1964
|
img.addEventListener('load', function () {
|
|
2035
1965
|
ctx.drawImage(img, 0, 0);
|
|
2036
1966
|
});
|
|
@@ -2045,12 +1975,12 @@
|
|
|
2045
1975
|
var ctx = /** @type {CanvasRenderingContext2D} */
|
|
2046
1976
|
canvas.getContext('2d');
|
|
2047
1977
|
var img = document.createElement('img');
|
|
2048
|
-
// The onload is needed by some browsers per
|
|
1978
|
+
// The onload is needed by some browsers per https://stackoverflow.com/a/4776378/271577
|
|
2049
1979
|
img.addEventListener('load', function () {
|
|
2050
1980
|
ctx.drawImage(img, 0, 0);
|
|
2051
1981
|
});
|
|
2052
1982
|
img.src = o.dataURL;
|
|
2053
|
-
return new
|
|
1983
|
+
return new TypesonPromise(/*#__PURE__*/function () {
|
|
2054
1984
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(resolve, reject) {
|
|
2055
1985
|
var resp, _t;
|
|
2056
1986
|
return _regenerator().w(function (_context) {
|
|
@@ -2093,7 +2023,7 @@
|
|
|
2093
2023
|
replace: function replace(d) {
|
|
2094
2024
|
return {
|
|
2095
2025
|
// Ensure `length` gets preserved for revival
|
|
2096
|
-
array: _toConsumableArray
|
|
2026
|
+
array: _toConsumableArray(d.data),
|
|
2097
2027
|
width: d.width,
|
|
2098
2028
|
height: d.height
|
|
2099
2029
|
};
|
|
@@ -2110,13 +2040,13 @@
|
|
|
2110
2040
|
var infinity = {
|
|
2111
2041
|
infinity: {
|
|
2112
2042
|
test: function test(x) {
|
|
2113
|
-
return x ===
|
|
2043
|
+
return x === Infinity;
|
|
2114
2044
|
},
|
|
2115
2045
|
replace: function replace() {
|
|
2116
2046
|
return 'Infinity';
|
|
2117
2047
|
} /* n */,
|
|
2118
2048
|
revive: function revive() {
|
|
2119
|
-
return
|
|
2049
|
+
return Infinity;
|
|
2120
2050
|
} /* s */
|
|
2121
2051
|
}
|
|
2122
2052
|
};
|
|
@@ -2180,7 +2110,7 @@
|
|
|
2180
2110
|
return toStringTag(x) === 'Map';
|
|
2181
2111
|
},
|
|
2182
2112
|
replace: function replace(mp) {
|
|
2183
|
-
return
|
|
2113
|
+
return mp.entries().toArray();
|
|
2184
2114
|
},
|
|
2185
2115
|
revive: function revive(entries) {
|
|
2186
2116
|
return new Map(entries);
|
|
@@ -2200,7 +2130,7 @@
|
|
|
2200
2130
|
return 'NaN';
|
|
2201
2131
|
} /* n */,
|
|
2202
2132
|
revive: function revive() {
|
|
2203
|
-
return
|
|
2133
|
+
return NaN;
|
|
2204
2134
|
} /* s */
|
|
2205
2135
|
}
|
|
2206
2136
|
};
|
|
@@ -2211,13 +2141,13 @@
|
|
|
2211
2141
|
var negativeInfinity = {
|
|
2212
2142
|
negativeInfinity: {
|
|
2213
2143
|
test: function test(x) {
|
|
2214
|
-
return x ===
|
|
2144
|
+
return x === -Infinity;
|
|
2215
2145
|
},
|
|
2216
2146
|
replace: function replace() {
|
|
2217
2147
|
return '-Infinity';
|
|
2218
2148
|
} /* n */,
|
|
2219
2149
|
revive: function revive() {
|
|
2220
|
-
return
|
|
2150
|
+
return -Infinity;
|
|
2221
2151
|
} /* s */
|
|
2222
2152
|
}
|
|
2223
2153
|
};
|
|
@@ -2246,7 +2176,7 @@
|
|
|
2246
2176
|
var nonbuiltinIgnore = {
|
|
2247
2177
|
nonbuiltinIgnore: {
|
|
2248
2178
|
test: function test(x) {
|
|
2249
|
-
return x && _typeof
|
|
2179
|
+
return x && _typeof(x) === 'object' && !Array.isArray(x) && !['Object',
|
|
2250
2180
|
// `Proxy` and `Reflect`, two other built-in objects, will also
|
|
2251
2181
|
// have a `toStringTag` of `Object`; we don't want built-in
|
|
2252
2182
|
// function objects, however
|
|
@@ -2265,7 +2195,7 @@
|
|
|
2265
2195
|
// String Object (not primitive string which need no type spec)
|
|
2266
2196
|
StringObject: {
|
|
2267
2197
|
test: function test(x) {
|
|
2268
|
-
return toStringTag(x) === 'String' && _typeof
|
|
2198
|
+
return toStringTag(x) === 'String' && _typeof(x) === 'object';
|
|
2269
2199
|
},
|
|
2270
2200
|
replace: String,
|
|
2271
2201
|
// convert to primitive string
|
|
@@ -2276,7 +2206,7 @@
|
|
|
2276
2206
|
// Boolean Object (not primitive boolean which need no type spec)
|
|
2277
2207
|
BooleanObject: {
|
|
2278
2208
|
test: function test(x) {
|
|
2279
|
-
return toStringTag(x) === 'Boolean' && _typeof
|
|
2209
|
+
return toStringTag(x) === 'Boolean' && _typeof(x) === 'object';
|
|
2280
2210
|
},
|
|
2281
2211
|
replace: function replace(o) {
|
|
2282
2212
|
// convert to primitive boolean
|
|
@@ -2290,7 +2220,7 @@
|
|
|
2290
2220
|
// Number Object (not primitive number which need no type spec)
|
|
2291
2221
|
NumberObject: {
|
|
2292
2222
|
test: function test(x) {
|
|
2293
|
-
return toStringTag(x) === 'Number' && _typeof
|
|
2223
|
+
return toStringTag(x) === 'Number' && _typeof(x) === 'object';
|
|
2294
2224
|
},
|
|
2295
2225
|
replace: Number,
|
|
2296
2226
|
// convert to primitive number
|
|
@@ -2309,7 +2239,7 @@
|
|
|
2309
2239
|
return toStringTag(x) === 'Promise';
|
|
2310
2240
|
},
|
|
2311
2241
|
replaceAsync: function replaceAsync(prom) {
|
|
2312
|
-
return new
|
|
2242
|
+
return new TypesonPromise(/*#__PURE__*/function () {
|
|
2313
2243
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(resolve) {
|
|
2314
2244
|
var _t, _t2, _t3;
|
|
2315
2245
|
return _regenerator().w(function (_context) {
|
|
@@ -2381,7 +2311,7 @@
|
|
|
2381
2311
|
var resurrectable = {
|
|
2382
2312
|
resurrectable: {
|
|
2383
2313
|
test: function test(x) {
|
|
2384
|
-
return x && !Array.isArray(x) && ['object', 'function', 'symbol'].includes(_typeof
|
|
2314
|
+
return x && !Array.isArray(x) && ['object', 'function', 'symbol'].includes(_typeof(x));
|
|
2385
2315
|
},
|
|
2386
2316
|
replace: function replace(rsrrctble) {
|
|
2387
2317
|
var uuid = generateUUID();
|
|
@@ -2403,7 +2333,7 @@
|
|
|
2403
2333
|
return toStringTag(x) === 'Set';
|
|
2404
2334
|
},
|
|
2405
2335
|
replace: function replace(st) {
|
|
2406
|
-
return
|
|
2336
|
+
return st.values().toArray();
|
|
2407
2337
|
},
|
|
2408
2338
|
revive: function revive(values) {
|
|
2409
2339
|
return new Set(values);
|
|
@@ -2417,7 +2347,7 @@
|
|
|
2417
2347
|
var symbol = {
|
|
2418
2348
|
symbol: {
|
|
2419
2349
|
test: function test(x) {
|
|
2420
|
-
return _typeof
|
|
2350
|
+
return _typeof(x) === 'symbol';
|
|
2421
2351
|
},
|
|
2422
2352
|
replace: function replace(sym) {
|
|
2423
2353
|
return {
|
|
@@ -2477,7 +2407,7 @@
|
|
|
2477
2407
|
// Those constructors are added in ES6 as a group.
|
|
2478
2408
|
// If we have Int8Array, we can assume the rest also exists.
|
|
2479
2409
|
|
|
2480
|
-
[Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].concat(_toConsumableArray
|
|
2410
|
+
[Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].concat(_toConsumableArray(typeof BigInt64Array === 'function' ? [BigInt64Array, BigUint64Array]
|
|
2481
2411
|
/* c8 ignore next */ : [])).forEach(function (TypedArray) {
|
|
2482
2412
|
return create$1(TypedArray);
|
|
2483
2413
|
});
|
|
@@ -2570,7 +2500,7 @@
|
|
|
2570
2500
|
if (typeof Int8Array === 'function') {
|
|
2571
2501
|
// Those constructors are added in ES6 as a group.
|
|
2572
2502
|
// If we have Int8Array, we can assume the rest also exists.
|
|
2573
|
-
[Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].concat(_toConsumableArray
|
|
2503
|
+
[Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array].concat(_toConsumableArray(typeof BigInt64Array === 'function' ? [BigInt64Array, BigUint64Array]
|
|
2574
2504
|
/* c8 ignore next */ : [])).forEach(function (TypedArray) {
|
|
2575
2505
|
return create(TypedArray);
|
|
2576
2506
|
});
|
|
@@ -2593,7 +2523,7 @@
|
|
|
2593
2523
|
revive: function revive() {
|
|
2594
2524
|
// Will add `undefined` (returning `undefined` would instead
|
|
2595
2525
|
// avoid explicitly setting)
|
|
2596
|
-
return new
|
|
2526
|
+
return new Undefined();
|
|
2597
2527
|
} /* s */
|
|
2598
2528
|
}
|
|
2599
2529
|
};
|
|
@@ -2607,7 +2537,7 @@
|
|
|
2607
2537
|
return isUserObject(x);
|
|
2608
2538
|
},
|
|
2609
2539
|
replace: function replace(n) {
|
|
2610
|
-
return _objectSpread2
|
|
2540
|
+
return _objectSpread2({}, n);
|
|
2611
2541
|
},
|
|
2612
2542
|
revive: function revive(s) {
|
|
2613
2543
|
return s;
|
|
@@ -2636,7 +2566,7 @@
|
|
|
2636
2566
|
// `Number.parseInt(Number())` since scientific
|
|
2637
2567
|
// notation will be pre-resolved if a number
|
|
2638
2568
|
// was given, and it will otherwise be a string
|
|
2639
|
-
return String(Number
|
|
2569
|
+
return String(Number(k)) !== k;
|
|
2640
2570
|
})) {
|
|
2641
2571
|
stateObj.iterateIn = 'object';
|
|
2642
2572
|
stateObj.addLength = true;
|
|
@@ -2662,7 +2592,7 @@
|
|
|
2662
2592
|
// No map here as may be a sparse array (including
|
|
2663
2593
|
// with `length` set)
|
|
2664
2594
|
Object.entries(o).forEach(function (_ref) {
|
|
2665
|
-
var _ref2 = _slicedToArray
|
|
2595
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
2666
2596
|
key = _ref2[0],
|
|
2667
2597
|
val = _ref2[1];
|
|
2668
2598
|
arr[key] = val;
|
|
@@ -2846,7 +2776,7 @@
|
|
|
2846
2776
|
// value, so we check `typeof`
|
|
2847
2777
|
'symbol',
|
|
2848
2778
|
// All functions including bound function exotic objects
|
|
2849
|
-
'function'].includes(_typeof
|
|
2779
|
+
'function'].includes(_typeof(val)) || [
|
|
2850
2780
|
// A non-array exotic object
|
|
2851
2781
|
'Arguments',
|
|
2852
2782
|
// A non-array exotic object
|
|
@@ -2869,7 +2799,7 @@
|
|
|
2869
2799
|
((stringTag === 'Blob' || stringTag === 'File') &&
|
|
2870
2800
|
val.isClosed) ||
|
|
2871
2801
|
*/
|
|
2872
|
-
val && _typeof
|
|
2802
|
+
val && _typeof(val) === 'object' &&
|
|
2873
2803
|
// Duck-type DOM node objects (non-array exotic?
|
|
2874
2804
|
// objects which cannot be cloned by the SCA)
|
|
2875
2805
|
typeof val.nodeType === 'number' && typeof val.insertBefore === 'function')) {
|
|
@@ -2893,10 +2823,10 @@
|
|
|
2893
2823
|
// built-in into ecmasript standard.
|
|
2894
2824
|
];
|
|
2895
2825
|
|
|
2896
|
-
exports.JSON_TYPES =
|
|
2897
|
-
exports.Typeson =
|
|
2898
|
-
exports.TypesonPromise =
|
|
2899
|
-
exports.Undefined =
|
|
2826
|
+
exports.JSON_TYPES = i$1;
|
|
2827
|
+
exports.Typeson = Typeson;
|
|
2828
|
+
exports.TypesonPromise = TypesonPromise;
|
|
2829
|
+
exports.Undefined = Undefined;
|
|
2900
2830
|
exports.arrayNonindexKeys = arrayNonindexKeys;
|
|
2901
2831
|
exports.arraybuffer = arraybuffer;
|
|
2902
2832
|
exports.bigint = bigint;
|