@blackglory/structures 0.6.4 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -1
- package/dist/es2015/index.min.mjs +2 -2
- package/dist/es2015/index.min.mjs.map +1 -1
- package/dist/es2015/index.mjs +892 -384
- package/dist/es2015/index.mjs.map +1 -1
- package/dist/es2015/index.umd.js +892 -383
- package/dist/es2015/index.umd.js.map +1 -1
- package/dist/es2015/index.umd.min.js +2 -2
- package/dist/es2015/index.umd.min.js.map +1 -1
- package/dist/es2018/index.min.mjs +2 -2
- package/dist/es2018/index.min.mjs.map +1 -1
- package/dist/es2018/index.mjs +892 -384
- package/dist/es2018/index.mjs.map +1 -1
- package/dist/es2018/index.umd.js +892 -383
- package/dist/es2018/index.umd.js.map +1 -1
- package/dist/es2018/index.umd.min.js +2 -2
- package/dist/es2018/index.umd.min.js.map +1 -1
- package/lib/es2015/box.d.ts +1 -0
- package/lib/es2015/box.js +3 -0
- package/lib/es2015/box.js.map +1 -1
- package/lib/es2015/cons.js +6 -2
- package/lib/es2015/cons.js.map +1 -1
- package/lib/es2015/dynamic-typed-array.d.ts +23 -0
- package/lib/es2015/dynamic-typed-array.js +114 -0
- package/lib/es2015/dynamic-typed-array.js.map +1 -0
- package/lib/es2015/finite-state-machine.d.ts +1 -0
- package/lib/es2015/finite-state-machine.js +3 -0
- package/lib/es2015/finite-state-machine.js.map +1 -1
- package/lib/es2015/index.d.ts +1 -0
- package/lib/es2015/index.js +3 -0
- package/lib/es2015/index.js.map +1 -1
- package/lib/es2015/observable-finite-state-machine.d.ts +1 -0
- package/lib/es2015/observable-finite-state-machine.js +3 -0
- package/lib/es2015/observable-finite-state-machine.js.map +1 -1
- package/lib/es2015/sparse-set.d.ts +3 -2
- package/lib/es2015/sparse-set.js +3 -0
- package/lib/es2015/sparse-set.js.map +1 -1
- package/lib/es2018/box.d.ts +1 -0
- package/lib/es2018/box.js +3 -0
- package/lib/es2018/box.js.map +1 -1
- package/lib/es2018/cons.js +6 -2
- package/lib/es2018/cons.js.map +1 -1
- package/lib/es2018/dynamic-typed-array.d.ts +23 -0
- package/lib/es2018/dynamic-typed-array.js +114 -0
- package/lib/es2018/dynamic-typed-array.js.map +1 -0
- package/lib/es2018/finite-state-machine.d.ts +1 -0
- package/lib/es2018/finite-state-machine.js +3 -0
- package/lib/es2018/finite-state-machine.js.map +1 -1
- package/lib/es2018/index.d.ts +1 -0
- package/lib/es2018/index.js +3 -0
- package/lib/es2018/index.js.map +1 -1
- package/lib/es2018/observable-finite-state-machine.d.ts +1 -0
- package/lib/es2018/observable-finite-state-machine.js +3 -0
- package/lib/es2018/observable-finite-state-machine.js.map +1 -1
- package/lib/es2018/sparse-set.d.ts +3 -2
- package/lib/es2018/sparse-set.js +3 -0
- package/lib/es2018/sparse-set.js.map +1 -1
- package/package.json +3 -3
package/dist/es2015/index.umd.js
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
constructor(value) {
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
|
+
get [Symbol.toStringTag]() {
|
|
12
|
+
return this.constructor.name;
|
|
13
|
+
}
|
|
11
14
|
set(value) {
|
|
12
15
|
this.value = value;
|
|
13
16
|
}
|
|
@@ -16,10 +19,629 @@
|
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
|
|
22
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
23
|
+
|
|
24
|
+
var es2018$e = {};
|
|
25
|
+
|
|
26
|
+
var array$2 = {};
|
|
27
|
+
|
|
28
|
+
array$2.isntEmptyArray = array$2.isEmptyArray = array$2.isntArray = array$2.isArray = void 0;
|
|
29
|
+
function isArray$2(val) {
|
|
30
|
+
return Array.isArray(val);
|
|
31
|
+
}
|
|
32
|
+
array$2.isArray = isArray$2;
|
|
33
|
+
function isntArray$2(val) {
|
|
34
|
+
return !isArray$2(val);
|
|
35
|
+
}
|
|
36
|
+
array$2.isntArray = isntArray$2;
|
|
37
|
+
function isEmptyArray$2(val) {
|
|
38
|
+
return val.length === 0;
|
|
39
|
+
}
|
|
40
|
+
array$2.isEmptyArray = isEmptyArray$2;
|
|
41
|
+
function isntEmptyArray$2(val) {
|
|
42
|
+
return val.length !== 0;
|
|
43
|
+
}
|
|
44
|
+
array$2.isntEmptyArray = isntEmptyArray$2;
|
|
45
|
+
|
|
46
|
+
var asyncIterable$2 = {};
|
|
47
|
+
|
|
48
|
+
var _null$2 = {};
|
|
49
|
+
|
|
50
|
+
_null$2.isntNull = _null$2.isNull = void 0;
|
|
51
|
+
function isNull$2(val) {
|
|
52
|
+
return val === null;
|
|
53
|
+
}
|
|
54
|
+
_null$2.isNull = isNull$2;
|
|
55
|
+
function isntNull$2(val) {
|
|
56
|
+
return !isNull$2(val);
|
|
57
|
+
}
|
|
58
|
+
_null$2.isntNull = isntNull$2;
|
|
59
|
+
|
|
60
|
+
var _undefined$2 = {};
|
|
61
|
+
|
|
62
|
+
_undefined$2.isntUndefined = _undefined$2.isUndefined = void 0;
|
|
63
|
+
function isUndefined$2(val) {
|
|
64
|
+
return val === undefined;
|
|
65
|
+
}
|
|
66
|
+
_undefined$2.isUndefined = isUndefined$2;
|
|
67
|
+
function isntUndefined$2(val) {
|
|
68
|
+
return !isUndefined$2(val);
|
|
69
|
+
}
|
|
70
|
+
_undefined$2.isntUndefined = isntUndefined$2;
|
|
71
|
+
|
|
72
|
+
var _function$2 = {};
|
|
73
|
+
|
|
74
|
+
_function$2.isntFunction = _function$2.isFunction = void 0;
|
|
75
|
+
function isFunction$3(val) {
|
|
76
|
+
return typeof val === 'function';
|
|
77
|
+
}
|
|
78
|
+
_function$2.isFunction = isFunction$3;
|
|
79
|
+
function isntFunction$2(val) {
|
|
80
|
+
return !isFunction$3(val);
|
|
81
|
+
}
|
|
82
|
+
_function$2.isntFunction = isntFunction$2;
|
|
83
|
+
|
|
84
|
+
asyncIterable$2.isntAsyncIterable = asyncIterable$2.isAsyncIterable = void 0;
|
|
85
|
+
const null_1$7 = _null$2;
|
|
86
|
+
const undefined_1$6 = _undefined$2;
|
|
87
|
+
const function_1$5 = _function$2;
|
|
88
|
+
function isAsyncIterable$2(val) {
|
|
89
|
+
return (0, null_1$7.isntNull)(val)
|
|
90
|
+
&& (0, undefined_1$6.isntUndefined)(val)
|
|
91
|
+
&& (0, function_1$5.isFunction)(val[Symbol.asyncIterator]);
|
|
92
|
+
}
|
|
93
|
+
asyncIterable$2.isAsyncIterable = isAsyncIterable$2;
|
|
94
|
+
function isntAsyncIterable$2(val) {
|
|
95
|
+
return !isAsyncIterable$2(val);
|
|
96
|
+
}
|
|
97
|
+
asyncIterable$2.isntAsyncIterable = isntAsyncIterable$2;
|
|
98
|
+
|
|
99
|
+
var bigint$2 = {};
|
|
100
|
+
|
|
101
|
+
bigint$2.isntBigInt = bigint$2.isBigInt = void 0;
|
|
102
|
+
function isBigInt$2(val) {
|
|
103
|
+
return typeof val === 'bigint';
|
|
104
|
+
}
|
|
105
|
+
bigint$2.isBigInt = isBigInt$2;
|
|
106
|
+
function isntBigInt$2(val) {
|
|
107
|
+
return !isBigInt$2(val);
|
|
108
|
+
}
|
|
109
|
+
bigint$2.isntBigInt = isntBigInt$2;
|
|
110
|
+
|
|
111
|
+
var boolean$2 = {};
|
|
112
|
+
|
|
113
|
+
boolean$2.isntBoolean = boolean$2.isBoolean = void 0;
|
|
114
|
+
function isBoolean$2(val) {
|
|
115
|
+
return typeof val === 'boolean';
|
|
116
|
+
}
|
|
117
|
+
boolean$2.isBoolean = isBoolean$2;
|
|
118
|
+
function isntBoolean$2(val) {
|
|
119
|
+
return !isBoolean$2(val);
|
|
120
|
+
}
|
|
121
|
+
boolean$2.isntBoolean = isntBoolean$2;
|
|
122
|
+
|
|
123
|
+
var char$2 = {};
|
|
124
|
+
|
|
125
|
+
var string$2 = {};
|
|
126
|
+
|
|
127
|
+
string$2.isntString = string$2.isString = void 0;
|
|
128
|
+
function isString$2(val) {
|
|
129
|
+
return typeof val === 'string';
|
|
130
|
+
}
|
|
131
|
+
string$2.isString = isString$2;
|
|
132
|
+
function isntString$2(val) {
|
|
133
|
+
return !isString$2(val);
|
|
134
|
+
}
|
|
135
|
+
string$2.isntString = isntString$2;
|
|
136
|
+
|
|
137
|
+
char$2.isntChar = char$2.isChar = void 0;
|
|
138
|
+
const string_1$5 = string$2;
|
|
139
|
+
function isChar$2(val) {
|
|
140
|
+
return (0, string_1$5.isString)(val)
|
|
141
|
+
&& val.length === 1;
|
|
142
|
+
}
|
|
143
|
+
char$2.isChar = isChar$2;
|
|
144
|
+
function isntChar$2(val) {
|
|
145
|
+
return !isChar$2(val);
|
|
146
|
+
}
|
|
147
|
+
char$2.isntChar = isntChar$2;
|
|
148
|
+
|
|
149
|
+
var date$2 = {};
|
|
150
|
+
|
|
151
|
+
date$2.isntDate = date$2.isDate = void 0;
|
|
152
|
+
function isDate$2(val) {
|
|
153
|
+
return val instanceof Date;
|
|
154
|
+
}
|
|
155
|
+
date$2.isDate = isDate$2;
|
|
156
|
+
function isntDate$2(val) {
|
|
157
|
+
return !isDate$2(val);
|
|
158
|
+
}
|
|
159
|
+
date$2.isntDate = isntDate$2;
|
|
160
|
+
|
|
161
|
+
var _enum$2 = {};
|
|
162
|
+
|
|
163
|
+
_enum$2.inEnum = void 0;
|
|
164
|
+
function inEnum$2(val, _enum) {
|
|
165
|
+
return Object.values(_enum).includes(val);
|
|
166
|
+
}
|
|
167
|
+
_enum$2.inEnum = inEnum$2;
|
|
168
|
+
|
|
169
|
+
var error$2 = {};
|
|
170
|
+
|
|
171
|
+
error$2.isntError = error$2.isError = void 0;
|
|
172
|
+
function isError$2(val) {
|
|
173
|
+
return val instanceof Error;
|
|
174
|
+
}
|
|
175
|
+
error$2.isError = isError$2;
|
|
176
|
+
function isntError$2(val) {
|
|
177
|
+
return !isError$2(val);
|
|
178
|
+
}
|
|
179
|
+
error$2.isntError = isntError$2;
|
|
180
|
+
|
|
181
|
+
var falsy$2 = {};
|
|
182
|
+
|
|
183
|
+
falsy$2.isntFalsy = falsy$2.isFalsy = void 0;
|
|
184
|
+
function isFalsy$2(val) {
|
|
185
|
+
return !val;
|
|
186
|
+
}
|
|
187
|
+
falsy$2.isFalsy = isFalsy$2;
|
|
188
|
+
function isntFalsy$2(val) {
|
|
189
|
+
return !isFalsy$2(val);
|
|
190
|
+
}
|
|
191
|
+
falsy$2.isntFalsy = isntFalsy$2;
|
|
192
|
+
|
|
193
|
+
var iterable$2 = {};
|
|
194
|
+
|
|
195
|
+
iterable$2.isntIterable = iterable$2.isIterable = void 0;
|
|
196
|
+
const null_1$6 = _null$2;
|
|
197
|
+
const undefined_1$5 = _undefined$2;
|
|
198
|
+
const function_1$4 = _function$2;
|
|
199
|
+
function isIterable$2(val) {
|
|
200
|
+
return (0, null_1$6.isntNull)(val)
|
|
201
|
+
&& (0, undefined_1$5.isntUndefined)(val)
|
|
202
|
+
&& (0, function_1$4.isFunction)(val[Symbol.iterator]);
|
|
203
|
+
}
|
|
204
|
+
iterable$2.isIterable = isIterable$2;
|
|
205
|
+
function isntIterable$2(val) {
|
|
206
|
+
return !isIterable$2(val);
|
|
207
|
+
}
|
|
208
|
+
iterable$2.isntIterable = isntIterable$2;
|
|
209
|
+
|
|
210
|
+
var json$2 = {};
|
|
211
|
+
|
|
212
|
+
var number$2 = {};
|
|
213
|
+
|
|
214
|
+
number$2.isntNaN = number$2.isNaN = number$2.isNegativeInfinity = number$2.isPositiveInfinity = number$2.isFinite = number$2.isntNumber = number$2.isNumber = void 0;
|
|
215
|
+
function isNumber$2(val) {
|
|
216
|
+
return typeof val === 'number';
|
|
217
|
+
}
|
|
218
|
+
number$2.isNumber = isNumber$2;
|
|
219
|
+
function isntNumber$2(val) {
|
|
220
|
+
return !isNumber$2(val);
|
|
221
|
+
}
|
|
222
|
+
number$2.isntNumber = isntNumber$2;
|
|
223
|
+
function isFinite$1(val) {
|
|
224
|
+
return Number.isFinite(val);
|
|
225
|
+
}
|
|
226
|
+
number$2.isFinite = isFinite$1;
|
|
227
|
+
function isPositiveInfinity$1(val) {
|
|
228
|
+
return val === Infinity;
|
|
229
|
+
}
|
|
230
|
+
number$2.isPositiveInfinity = isPositiveInfinity$1;
|
|
231
|
+
function isNegativeInfinity$1(val) {
|
|
232
|
+
return val === -Infinity;
|
|
233
|
+
}
|
|
234
|
+
number$2.isNegativeInfinity = isNegativeInfinity$1;
|
|
235
|
+
function isNaN$1(val) {
|
|
236
|
+
return Number.isNaN(val);
|
|
237
|
+
}
|
|
238
|
+
number$2.isNaN = isNaN$1;
|
|
239
|
+
function isntNaN$1(val) {
|
|
240
|
+
return !isNaN$1(val);
|
|
241
|
+
}
|
|
242
|
+
number$2.isntNaN = isntNaN$1;
|
|
243
|
+
|
|
244
|
+
var object$2 = {};
|
|
245
|
+
|
|
246
|
+
/** Detect free variable `global` from Node.js. */
|
|
247
|
+
|
|
248
|
+
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
249
|
+
|
|
250
|
+
var _freeGlobal = freeGlobal$1;
|
|
251
|
+
|
|
252
|
+
var freeGlobal = _freeGlobal;
|
|
253
|
+
|
|
254
|
+
/** Detect free variable `self`. */
|
|
255
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
256
|
+
|
|
257
|
+
/** Used as a reference to the global object. */
|
|
258
|
+
var root$1 = freeGlobal || freeSelf || Function('return this')();
|
|
259
|
+
|
|
260
|
+
var _root = root$1;
|
|
261
|
+
|
|
262
|
+
var root = _root;
|
|
263
|
+
|
|
264
|
+
/** Built-in value references. */
|
|
265
|
+
var Symbol$3 = root.Symbol;
|
|
266
|
+
|
|
267
|
+
var _Symbol = Symbol$3;
|
|
268
|
+
|
|
269
|
+
var Symbol$2 = _Symbol;
|
|
270
|
+
|
|
271
|
+
/** Used for built-in method references. */
|
|
272
|
+
var objectProto$3 = Object.prototype;
|
|
273
|
+
|
|
274
|
+
/** Used to check objects for own properties. */
|
|
275
|
+
var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Used to resolve the
|
|
279
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
280
|
+
* of values.
|
|
281
|
+
*/
|
|
282
|
+
var nativeObjectToString$1 = objectProto$3.toString;
|
|
283
|
+
|
|
284
|
+
/** Built-in value references. */
|
|
285
|
+
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
289
|
+
*
|
|
290
|
+
* @private
|
|
291
|
+
* @param {*} value The value to query.
|
|
292
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
293
|
+
*/
|
|
294
|
+
function getRawTag$1(value) {
|
|
295
|
+
var isOwn = hasOwnProperty$2.call(value, symToStringTag$1),
|
|
296
|
+
tag = value[symToStringTag$1];
|
|
297
|
+
|
|
298
|
+
try {
|
|
299
|
+
value[symToStringTag$1] = undefined;
|
|
300
|
+
var unmasked = true;
|
|
301
|
+
} catch (e) {}
|
|
302
|
+
|
|
303
|
+
var result = nativeObjectToString$1.call(value);
|
|
304
|
+
if (unmasked) {
|
|
305
|
+
if (isOwn) {
|
|
306
|
+
value[symToStringTag$1] = tag;
|
|
307
|
+
} else {
|
|
308
|
+
delete value[symToStringTag$1];
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return result;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
var _getRawTag = getRawTag$1;
|
|
315
|
+
|
|
316
|
+
/** Used for built-in method references. */
|
|
317
|
+
|
|
318
|
+
var objectProto$2 = Object.prototype;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Used to resolve the
|
|
322
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
323
|
+
* of values.
|
|
324
|
+
*/
|
|
325
|
+
var nativeObjectToString = objectProto$2.toString;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
329
|
+
*
|
|
330
|
+
* @private
|
|
331
|
+
* @param {*} value The value to convert.
|
|
332
|
+
* @returns {string} Returns the converted string.
|
|
333
|
+
*/
|
|
334
|
+
function objectToString$2(value) {
|
|
335
|
+
return nativeObjectToString.call(value);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
var _objectToString = objectToString$2;
|
|
339
|
+
|
|
340
|
+
var Symbol$1 = _Symbol,
|
|
341
|
+
getRawTag = _getRawTag,
|
|
342
|
+
objectToString$1 = _objectToString;
|
|
343
|
+
|
|
344
|
+
/** `Object#toString` result references. */
|
|
345
|
+
var nullTag = '[object Null]',
|
|
346
|
+
undefinedTag = '[object Undefined]';
|
|
347
|
+
|
|
348
|
+
/** Built-in value references. */
|
|
349
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
353
|
+
*
|
|
354
|
+
* @private
|
|
355
|
+
* @param {*} value The value to query.
|
|
356
|
+
* @returns {string} Returns the `toStringTag`.
|
|
357
|
+
*/
|
|
358
|
+
function baseGetTag$1(value) {
|
|
359
|
+
if (value == null) {
|
|
360
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
361
|
+
}
|
|
362
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
363
|
+
? getRawTag(value)
|
|
364
|
+
: objectToString$1(value);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
var _baseGetTag = baseGetTag$1;
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
371
|
+
*
|
|
372
|
+
* @private
|
|
373
|
+
* @param {Function} func The function to wrap.
|
|
374
|
+
* @param {Function} transform The argument transform.
|
|
375
|
+
* @returns {Function} Returns the new function.
|
|
376
|
+
*/
|
|
377
|
+
|
|
378
|
+
function overArg$2(func, transform) {
|
|
379
|
+
return function(arg) {
|
|
380
|
+
return func(transform(arg));
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
var _overArg = overArg$2;
|
|
385
|
+
|
|
386
|
+
var overArg$1 = _overArg;
|
|
387
|
+
|
|
388
|
+
/** Built-in value references. */
|
|
389
|
+
var getPrototype$2 = overArg$1(Object.getPrototypeOf, Object);
|
|
390
|
+
|
|
391
|
+
var _getPrototype = getPrototype$2;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
395
|
+
* and has a `typeof` result of "object".
|
|
396
|
+
*
|
|
397
|
+
* @static
|
|
398
|
+
* @memberOf _
|
|
399
|
+
* @since 4.0.0
|
|
400
|
+
* @category Lang
|
|
401
|
+
* @param {*} value The value to check.
|
|
402
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
403
|
+
* @example
|
|
404
|
+
*
|
|
405
|
+
* _.isObjectLike({});
|
|
406
|
+
* // => true
|
|
407
|
+
*
|
|
408
|
+
* _.isObjectLike([1, 2, 3]);
|
|
409
|
+
* // => true
|
|
410
|
+
*
|
|
411
|
+
* _.isObjectLike(_.noop);
|
|
412
|
+
* // => false
|
|
413
|
+
*
|
|
414
|
+
* _.isObjectLike(null);
|
|
415
|
+
* // => false
|
|
416
|
+
*/
|
|
417
|
+
|
|
418
|
+
function isObjectLike$2(value) {
|
|
419
|
+
return value != null && typeof value == 'object';
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
var isObjectLike_1 = isObjectLike$2;
|
|
423
|
+
|
|
424
|
+
var baseGetTag = _baseGetTag,
|
|
425
|
+
getPrototype$1 = _getPrototype,
|
|
426
|
+
isObjectLike$1 = isObjectLike_1;
|
|
427
|
+
|
|
428
|
+
/** `Object#toString` result references. */
|
|
429
|
+
var objectTag$1 = '[object Object]';
|
|
430
|
+
|
|
431
|
+
/** Used for built-in method references. */
|
|
432
|
+
var funcProto$1 = Function.prototype,
|
|
433
|
+
objectProto$1 = Object.prototype;
|
|
434
|
+
|
|
435
|
+
/** Used to resolve the decompiled source of functions. */
|
|
436
|
+
var funcToString$1 = funcProto$1.toString;
|
|
437
|
+
|
|
438
|
+
/** Used to check objects for own properties. */
|
|
439
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
440
|
+
|
|
441
|
+
/** Used to infer the `Object` constructor. */
|
|
442
|
+
var objectCtorString$1 = funcToString$1.call(Object);
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Checks if `value` is a plain object, that is, an object created by the
|
|
446
|
+
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
447
|
+
*
|
|
448
|
+
* @static
|
|
449
|
+
* @memberOf _
|
|
450
|
+
* @since 0.8.0
|
|
451
|
+
* @category Lang
|
|
452
|
+
* @param {*} value The value to check.
|
|
453
|
+
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
454
|
+
* @example
|
|
455
|
+
*
|
|
456
|
+
* function Foo() {
|
|
457
|
+
* this.a = 1;
|
|
458
|
+
* }
|
|
459
|
+
*
|
|
460
|
+
* _.isPlainObject(new Foo);
|
|
461
|
+
* // => false
|
|
462
|
+
*
|
|
463
|
+
* _.isPlainObject([1, 2, 3]);
|
|
464
|
+
* // => false
|
|
465
|
+
*
|
|
466
|
+
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
467
|
+
* // => true
|
|
468
|
+
*
|
|
469
|
+
* _.isPlainObject(Object.create(null));
|
|
470
|
+
* // => true
|
|
471
|
+
*/
|
|
472
|
+
function isPlainObject$4(value) {
|
|
473
|
+
if (!isObjectLike$1(value) || baseGetTag(value) != objectTag$1) {
|
|
474
|
+
return false;
|
|
475
|
+
}
|
|
476
|
+
var proto = getPrototype$1(value);
|
|
477
|
+
if (proto === null) {
|
|
478
|
+
return true;
|
|
479
|
+
}
|
|
480
|
+
var Ctor = hasOwnProperty$1.call(proto, 'constructor') && proto.constructor;
|
|
481
|
+
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
482
|
+
funcToString$1.call(Ctor) == objectCtorString$1;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
var isPlainObject_1$2 = isPlainObject$4;
|
|
486
|
+
|
|
487
|
+
var __importDefault$2 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
488
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
489
|
+
};object$2.isntEmptyObject = object$2.isEmptyObject = object$2.isntPlainObject = object$2.isPlainObject = object$2.isntObject = object$2.isObject = void 0;
|
|
490
|
+
const isPlainObject_1$1 = __importDefault$2(isPlainObject_1$2);
|
|
491
|
+
function isObject$2(val) {
|
|
492
|
+
return val !== null
|
|
493
|
+
&& typeof val === 'object';
|
|
494
|
+
}
|
|
495
|
+
object$2.isObject = isObject$2;
|
|
496
|
+
function isntObject$2(val) {
|
|
497
|
+
return !isObject$2(val);
|
|
498
|
+
}
|
|
499
|
+
object$2.isntObject = isntObject$2;
|
|
500
|
+
function isPlainObject$3(val) {
|
|
501
|
+
return (0, isPlainObject_1$1.default)(val);
|
|
502
|
+
}
|
|
503
|
+
object$2.isPlainObject = isPlainObject$3;
|
|
504
|
+
function isntPlainObject$2(val) {
|
|
505
|
+
return !isPlainObject$3(val);
|
|
506
|
+
}
|
|
507
|
+
object$2.isntPlainObject = isntPlainObject$2;
|
|
508
|
+
function isEmptyObject$2(val) {
|
|
509
|
+
return Object.keys(val).length === 0;
|
|
510
|
+
}
|
|
511
|
+
object$2.isEmptyObject = isEmptyObject$2;
|
|
512
|
+
function isntEmptyObject$2(val) {
|
|
513
|
+
return Object.keys(val).length !== 0;
|
|
514
|
+
}
|
|
515
|
+
object$2.isntEmptyObject = isntEmptyObject$2;
|
|
516
|
+
|
|
517
|
+
json$2.isntJsonable = json$2.isJsonable = json$2.isntJson = json$2.isJson = void 0;
|
|
518
|
+
const null_1$5 = _null$2;
|
|
519
|
+
const boolean_1$1 = boolean$2;
|
|
520
|
+
const string_1$4 = string$2;
|
|
521
|
+
const number_1$2 = number$2;
|
|
522
|
+
const array_1$2 = array$2;
|
|
523
|
+
const object_1$4 = object$2;
|
|
524
|
+
function isJson$2(val) {
|
|
525
|
+
return (0, null_1$5.isNull)(val)
|
|
526
|
+
|| (0, boolean_1$1.isBoolean)(val)
|
|
527
|
+
|| (0, string_1$4.isString)(val)
|
|
528
|
+
|| (0, number_1$2.isNumber)(val)
|
|
529
|
+
|| ((0, array_1$2.isArray)(val) && val.every(isJson$2))
|
|
530
|
+
|| ((0, object_1$4.isPlainObject)(val) && Object.values(val).every(isJson$2));
|
|
531
|
+
}
|
|
532
|
+
json$2.isJson = isJson$2;
|
|
533
|
+
function isntJson$2(val) {
|
|
534
|
+
return !isJson$2(val);
|
|
535
|
+
}
|
|
536
|
+
json$2.isntJson = isntJson$2;
|
|
537
|
+
function isJsonable$1(val) {
|
|
538
|
+
try {
|
|
539
|
+
JSON.stringify(val);
|
|
540
|
+
return true;
|
|
541
|
+
}
|
|
542
|
+
catch (_a) {
|
|
543
|
+
return false;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
json$2.isJsonable = isJsonable$1;
|
|
547
|
+
function isntJsonable$1(val) {
|
|
548
|
+
return !isntJsonable$1();
|
|
549
|
+
}
|
|
550
|
+
json$2.isntJsonable = isntJsonable$1;
|
|
551
|
+
|
|
552
|
+
var promise$1 = {};
|
|
553
|
+
|
|
554
|
+
promise$1.isPromiseLike = promise$1.isntPromiseLike = promise$1.isntPromise = promise$1.isPromise = void 0;
|
|
555
|
+
const object_1$3 = object$2;
|
|
556
|
+
const function_1$3 = _function$2;
|
|
557
|
+
function isPromise$1(val) {
|
|
558
|
+
return val instanceof Promise;
|
|
559
|
+
}
|
|
560
|
+
promise$1.isPromise = isPromise$1;
|
|
561
|
+
function isntPromise$1(val) {
|
|
562
|
+
return !isPromise$1(val);
|
|
563
|
+
}
|
|
564
|
+
promise$1.isntPromise = isntPromise$1;
|
|
565
|
+
function isntPromiseLike$1(val) {
|
|
566
|
+
return !isPromiseLike$1(val);
|
|
567
|
+
}
|
|
568
|
+
promise$1.isntPromiseLike = isntPromiseLike$1;
|
|
569
|
+
function isPromiseLike$1(val) {
|
|
570
|
+
return (0, object_1$3.isObject)(val)
|
|
571
|
+
&& (0, function_1$3.isFunction)(val.then);
|
|
572
|
+
}
|
|
573
|
+
promise$1.isPromiseLike = isPromiseLike$1;
|
|
574
|
+
|
|
575
|
+
var url$2 = {};
|
|
576
|
+
|
|
577
|
+
url$2.isAbsoluteURL = void 0;
|
|
578
|
+
function isAbsoluteURL$2(str) {
|
|
579
|
+
try {
|
|
580
|
+
new URL(str);
|
|
581
|
+
return true;
|
|
582
|
+
}
|
|
583
|
+
catch (_a) {
|
|
584
|
+
return false;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
url$2.isAbsoluteURL = isAbsoluteURL$2;
|
|
588
|
+
|
|
589
|
+
var regexp = {};
|
|
590
|
+
|
|
591
|
+
regexp.isntRegExp = regexp.isRegExp = void 0;
|
|
592
|
+
function isRegExp(val) {
|
|
593
|
+
return val instanceof RegExp;
|
|
594
|
+
}
|
|
595
|
+
regexp.isRegExp = isRegExp;
|
|
596
|
+
function isntRegExp(val) {
|
|
597
|
+
return !isRegExp(val);
|
|
598
|
+
}
|
|
599
|
+
regexp.isntRegExp = isntRegExp;
|
|
600
|
+
|
|
601
|
+
(function (exports) {
|
|
602
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
603
|
+
if (k2 === undefined) k2 = k;
|
|
604
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
605
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
606
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
607
|
+
}
|
|
608
|
+
Object.defineProperty(o, k2, desc);
|
|
609
|
+
}) : (function(o, m, k, k2) {
|
|
610
|
+
if (k2 === undefined) k2 = k;
|
|
611
|
+
o[k2] = m[k];
|
|
612
|
+
}));
|
|
613
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
614
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
615
|
+
};__exportStar(array$2, exports);
|
|
616
|
+
__exportStar(asyncIterable$2, exports);
|
|
617
|
+
__exportStar(bigint$2, exports);
|
|
618
|
+
__exportStar(boolean$2, exports);
|
|
619
|
+
__exportStar(char$2, exports);
|
|
620
|
+
__exportStar(date$2, exports);
|
|
621
|
+
__exportStar(_enum$2, exports);
|
|
622
|
+
__exportStar(error$2, exports);
|
|
623
|
+
__exportStar(falsy$2, exports);
|
|
624
|
+
__exportStar(_function$2, exports);
|
|
625
|
+
__exportStar(iterable$2, exports);
|
|
626
|
+
__exportStar(json$2, exports);
|
|
627
|
+
__exportStar(_null$2, exports);
|
|
628
|
+
__exportStar(number$2, exports);
|
|
629
|
+
__exportStar(object$2, exports);
|
|
630
|
+
__exportStar(promise$1, exports);
|
|
631
|
+
__exportStar(string$2, exports);
|
|
632
|
+
__exportStar(_undefined$2, exports);
|
|
633
|
+
__exportStar(url$2, exports);
|
|
634
|
+
__exportStar(regexp, exports);
|
|
635
|
+
|
|
636
|
+
} (es2018$e));
|
|
637
|
+
|
|
19
638
|
function convertConsToArray([value, next]) {
|
|
20
|
-
if (next
|
|
639
|
+
if (es2018$e.isNull(next)) {
|
|
21
640
|
return [value];
|
|
22
|
-
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
return [value, ...convertConsToArray(next)];
|
|
644
|
+
}
|
|
23
645
|
}
|
|
24
646
|
function convertArrayToCons([value, ...next]) {
|
|
25
647
|
return [value, next.length ? convertArrayToCons(next) : null];
|
|
@@ -153,8 +775,6 @@
|
|
|
153
775
|
}
|
|
154
776
|
}
|
|
155
777
|
|
|
156
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
157
|
-
|
|
158
778
|
var es2018$d = {};
|
|
159
779
|
|
|
160
780
|
var customError$2 = {};
|
|
@@ -500,7 +1120,7 @@
|
|
|
500
1120
|
*/
|
|
501
1121
|
|
|
502
1122
|
/** `Object#toString` result references. */
|
|
503
|
-
var objectTag
|
|
1123
|
+
var objectTag = '[object Object]';
|
|
504
1124
|
|
|
505
1125
|
/**
|
|
506
1126
|
* Checks if `value` is a host object in IE < 9.
|
|
@@ -529,34 +1149,34 @@
|
|
|
529
1149
|
* @param {Function} transform The argument transform.
|
|
530
1150
|
* @returns {Function} Returns the new function.
|
|
531
1151
|
*/
|
|
532
|
-
function overArg
|
|
1152
|
+
function overArg(func, transform) {
|
|
533
1153
|
return function(arg) {
|
|
534
1154
|
return func(transform(arg));
|
|
535
1155
|
};
|
|
536
1156
|
}
|
|
537
1157
|
|
|
538
1158
|
/** Used for built-in method references. */
|
|
539
|
-
var funcProto
|
|
540
|
-
objectProto
|
|
1159
|
+
var funcProto = Function.prototype,
|
|
1160
|
+
objectProto = Object.prototype;
|
|
541
1161
|
|
|
542
1162
|
/** Used to resolve the decompiled source of functions. */
|
|
543
|
-
var funcToString
|
|
1163
|
+
var funcToString = funcProto.toString;
|
|
544
1164
|
|
|
545
1165
|
/** Used to check objects for own properties. */
|
|
546
|
-
var hasOwnProperty
|
|
1166
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
547
1167
|
|
|
548
1168
|
/** Used to infer the `Object` constructor. */
|
|
549
|
-
var objectCtorString
|
|
1169
|
+
var objectCtorString = funcToString.call(Object);
|
|
550
1170
|
|
|
551
1171
|
/**
|
|
552
1172
|
* Used to resolve the
|
|
553
1173
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
554
1174
|
* of values.
|
|
555
1175
|
*/
|
|
556
|
-
var objectToString
|
|
1176
|
+
var objectToString = objectProto.toString;
|
|
557
1177
|
|
|
558
1178
|
/** Built-in value references. */
|
|
559
|
-
var getPrototype
|
|
1179
|
+
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
560
1180
|
|
|
561
1181
|
/**
|
|
562
1182
|
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
@@ -582,7 +1202,7 @@
|
|
|
582
1202
|
* _.isObjectLike(null);
|
|
583
1203
|
* // => false
|
|
584
1204
|
*/
|
|
585
|
-
function isObjectLike
|
|
1205
|
+
function isObjectLike(value) {
|
|
586
1206
|
return !!value && typeof value == 'object';
|
|
587
1207
|
}
|
|
588
1208
|
|
|
@@ -614,21 +1234,21 @@
|
|
|
614
1234
|
* _.isPlainObject(Object.create(null));
|
|
615
1235
|
* // => true
|
|
616
1236
|
*/
|
|
617
|
-
function isPlainObject$
|
|
618
|
-
if (!isObjectLike
|
|
619
|
-
objectToString
|
|
1237
|
+
function isPlainObject$2(value) {
|
|
1238
|
+
if (!isObjectLike(value) ||
|
|
1239
|
+
objectToString.call(value) != objectTag || isHostObject(value)) {
|
|
620
1240
|
return false;
|
|
621
1241
|
}
|
|
622
|
-
var proto = getPrototype
|
|
1242
|
+
var proto = getPrototype(value);
|
|
623
1243
|
if (proto === null) {
|
|
624
1244
|
return true;
|
|
625
1245
|
}
|
|
626
|
-
var Ctor = hasOwnProperty
|
|
1246
|
+
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
627
1247
|
return (typeof Ctor == 'function' &&
|
|
628
|
-
Ctor instanceof Ctor && funcToString
|
|
1248
|
+
Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
|
|
629
1249
|
}
|
|
630
1250
|
|
|
631
|
-
var lodash_isplainobject = isPlainObject$
|
|
1251
|
+
var lodash_isplainobject = isPlainObject$2;
|
|
632
1252
|
|
|
633
1253
|
var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
634
1254
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -643,12 +1263,12 @@
|
|
|
643
1263
|
return !isObject$1(val);
|
|
644
1264
|
}
|
|
645
1265
|
object$1.isntObject = isntObject$1;
|
|
646
|
-
function isPlainObject$
|
|
1266
|
+
function isPlainObject$1(val) {
|
|
647
1267
|
return (0, lodash_isplainobject_1.default)(val);
|
|
648
1268
|
}
|
|
649
|
-
object$1.isPlainObject = isPlainObject$
|
|
1269
|
+
object$1.isPlainObject = isPlainObject$1;
|
|
650
1270
|
function isntPlainObject$1(val) {
|
|
651
|
-
return !isPlainObject$
|
|
1271
|
+
return !isPlainObject$1(val);
|
|
652
1272
|
}
|
|
653
1273
|
object$1.isntPlainObject = isntPlainObject$1;
|
|
654
1274
|
function isEmptyObject$1(val) {
|
|
@@ -4803,387 +5423,146 @@
|
|
|
4803
5423
|
return !isBigInt(val);
|
|
4804
5424
|
}
|
|
4805
5425
|
bigint.isntBigInt = isntBigInt;
|
|
4806
|
-
|
|
4807
|
-
var boolean = {};
|
|
4808
|
-
|
|
4809
|
-
boolean.isntBoolean = boolean.isBoolean = void 0;
|
|
4810
|
-
function isBoolean(val) {
|
|
4811
|
-
return typeof val === 'boolean';
|
|
4812
|
-
}
|
|
4813
|
-
boolean.isBoolean = isBoolean;
|
|
4814
|
-
function isntBoolean(val) {
|
|
4815
|
-
return !isBoolean(val);
|
|
4816
|
-
}
|
|
4817
|
-
boolean.isntBoolean = isntBoolean;
|
|
4818
|
-
|
|
4819
|
-
var char = {};
|
|
4820
|
-
|
|
4821
|
-
var string = {};
|
|
4822
|
-
|
|
4823
|
-
string.isntString = string.isString = void 0;
|
|
4824
|
-
function isString(val) {
|
|
4825
|
-
return typeof val === 'string';
|
|
4826
|
-
}
|
|
4827
|
-
string.isString = isString;
|
|
4828
|
-
function isntString(val) {
|
|
4829
|
-
return !isString(val);
|
|
4830
|
-
}
|
|
4831
|
-
string.isntString = isntString;
|
|
4832
|
-
|
|
4833
|
-
char.isntChar = char.isChar = void 0;
|
|
4834
|
-
const string_1$1 = string;
|
|
4835
|
-
function isChar(val) {
|
|
4836
|
-
return (0, string_1$1.isString)(val)
|
|
4837
|
-
&& val.length === 1;
|
|
4838
|
-
}
|
|
4839
|
-
char.isChar = isChar;
|
|
4840
|
-
function isntChar(val) {
|
|
4841
|
-
return !isChar(val);
|
|
4842
|
-
}
|
|
4843
|
-
char.isntChar = isntChar;
|
|
4844
|
-
|
|
4845
|
-
var date = {};
|
|
4846
|
-
|
|
4847
|
-
date.isntDate = date.isDate = void 0;
|
|
4848
|
-
function isDate(val) {
|
|
4849
|
-
return val instanceof Date;
|
|
4850
|
-
}
|
|
4851
|
-
date.isDate = isDate;
|
|
4852
|
-
function isntDate(val) {
|
|
4853
|
-
return !isDate(val);
|
|
4854
|
-
}
|
|
4855
|
-
date.isntDate = isntDate;
|
|
4856
|
-
|
|
4857
|
-
var _enum = {};
|
|
4858
|
-
|
|
4859
|
-
_enum.inEnum = void 0;
|
|
4860
|
-
function inEnum(val, _enum) {
|
|
4861
|
-
return Object.values(_enum).includes(val);
|
|
4862
|
-
}
|
|
4863
|
-
_enum.inEnum = inEnum;
|
|
4864
|
-
|
|
4865
|
-
var error = {};
|
|
4866
|
-
|
|
4867
|
-
error.isntError = error.isError = void 0;
|
|
4868
|
-
function isError(val) {
|
|
4869
|
-
return val instanceof Error;
|
|
4870
|
-
}
|
|
4871
|
-
error.isError = isError;
|
|
4872
|
-
function isntError(val) {
|
|
4873
|
-
return !isError(val);
|
|
4874
|
-
}
|
|
4875
|
-
error.isntError = isntError;
|
|
4876
|
-
|
|
4877
|
-
var falsy = {};
|
|
4878
|
-
|
|
4879
|
-
falsy.isntFalsy = falsy.isFalsy = void 0;
|
|
4880
|
-
function isFalsy(val) {
|
|
4881
|
-
return !val;
|
|
4882
|
-
}
|
|
4883
|
-
falsy.isFalsy = isFalsy;
|
|
4884
|
-
function isntFalsy(val) {
|
|
4885
|
-
return !isFalsy(val);
|
|
4886
|
-
}
|
|
4887
|
-
falsy.isntFalsy = isntFalsy;
|
|
4888
|
-
|
|
4889
|
-
var iterable = {};
|
|
4890
|
-
|
|
4891
|
-
iterable.isntIterable = iterable.isIterable = void 0;
|
|
4892
|
-
const null_1$1 = _null;
|
|
4893
|
-
const undefined_1 = _undefined;
|
|
4894
|
-
const function_1$1 = _function;
|
|
4895
|
-
function isIterable(val) {
|
|
4896
|
-
return (0, null_1$1.isntNull)(val)
|
|
4897
|
-
&& (0, undefined_1.isntUndefined)(val)
|
|
4898
|
-
&& (0, function_1$1.isFunction)(val[Symbol.iterator]);
|
|
4899
|
-
}
|
|
4900
|
-
iterable.isIterable = isIterable;
|
|
4901
|
-
function isntIterable(val) {
|
|
4902
|
-
return !isIterable(val);
|
|
4903
|
-
}
|
|
4904
|
-
iterable.isntIterable = isntIterable;
|
|
4905
|
-
|
|
4906
|
-
var json = {};
|
|
4907
|
-
|
|
4908
|
-
var number = {};
|
|
4909
|
-
|
|
4910
|
-
number.isntNaN = number.isNaN = number.isNegativeInfinity = number.isPositiveInfinity = number.isFinite = number.isntNumber = number.isNumber = void 0;
|
|
4911
|
-
function isNumber(val) {
|
|
4912
|
-
return typeof val === 'number';
|
|
4913
|
-
}
|
|
4914
|
-
number.isNumber = isNumber;
|
|
4915
|
-
function isntNumber(val) {
|
|
4916
|
-
return !isNumber(val);
|
|
4917
|
-
}
|
|
4918
|
-
number.isntNumber = isntNumber;
|
|
4919
|
-
function isFinite(val) {
|
|
4920
|
-
return Number.isFinite(val);
|
|
4921
|
-
}
|
|
4922
|
-
number.isFinite = isFinite;
|
|
4923
|
-
function isPositiveInfinity(val) {
|
|
4924
|
-
return val === Infinity;
|
|
4925
|
-
}
|
|
4926
|
-
number.isPositiveInfinity = isPositiveInfinity;
|
|
4927
|
-
function isNegativeInfinity(val) {
|
|
4928
|
-
return val === -Infinity;
|
|
4929
|
-
}
|
|
4930
|
-
number.isNegativeInfinity = isNegativeInfinity;
|
|
4931
|
-
function isNaN(val) {
|
|
4932
|
-
return Number.isNaN(val);
|
|
4933
|
-
}
|
|
4934
|
-
number.isNaN = isNaN;
|
|
4935
|
-
function isntNaN(val) {
|
|
4936
|
-
return !isNaN(val);
|
|
4937
|
-
}
|
|
4938
|
-
number.isntNaN = isntNaN;
|
|
4939
|
-
|
|
4940
|
-
var object = {};
|
|
4941
|
-
|
|
4942
|
-
/** Detect free variable `global` from Node.js. */
|
|
4943
|
-
|
|
4944
|
-
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
4945
|
-
|
|
4946
|
-
var _freeGlobal = freeGlobal$1;
|
|
4947
|
-
|
|
4948
|
-
var freeGlobal = _freeGlobal;
|
|
4949
|
-
|
|
4950
|
-
/** Detect free variable `self`. */
|
|
4951
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
4952
|
-
|
|
4953
|
-
/** Used as a reference to the global object. */
|
|
4954
|
-
var root$1 = freeGlobal || freeSelf || Function('return this')();
|
|
4955
|
-
|
|
4956
|
-
var _root = root$1;
|
|
4957
|
-
|
|
4958
|
-
var root = _root;
|
|
4959
|
-
|
|
4960
|
-
/** Built-in value references. */
|
|
4961
|
-
var Symbol$3 = root.Symbol;
|
|
4962
|
-
|
|
4963
|
-
var _Symbol = Symbol$3;
|
|
4964
|
-
|
|
4965
|
-
var Symbol$2 = _Symbol;
|
|
4966
|
-
|
|
4967
|
-
/** Used for built-in method references. */
|
|
4968
|
-
var objectProto$2 = Object.prototype;
|
|
4969
|
-
|
|
4970
|
-
/** Used to check objects for own properties. */
|
|
4971
|
-
var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
|
|
4972
|
-
|
|
4973
|
-
/**
|
|
4974
|
-
* Used to resolve the
|
|
4975
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
4976
|
-
* of values.
|
|
4977
|
-
*/
|
|
4978
|
-
var nativeObjectToString$1 = objectProto$2.toString;
|
|
4979
|
-
|
|
4980
|
-
/** Built-in value references. */
|
|
4981
|
-
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
4982
|
-
|
|
4983
|
-
/**
|
|
4984
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
4985
|
-
*
|
|
4986
|
-
* @private
|
|
4987
|
-
* @param {*} value The value to query.
|
|
4988
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
4989
|
-
*/
|
|
4990
|
-
function getRawTag$1(value) {
|
|
4991
|
-
var isOwn = hasOwnProperty$1.call(value, symToStringTag$1),
|
|
4992
|
-
tag = value[symToStringTag$1];
|
|
4993
|
-
|
|
4994
|
-
try {
|
|
4995
|
-
value[symToStringTag$1] = undefined;
|
|
4996
|
-
var unmasked = true;
|
|
4997
|
-
} catch (e) {}
|
|
4998
|
-
|
|
4999
|
-
var result = nativeObjectToString$1.call(value);
|
|
5000
|
-
if (unmasked) {
|
|
5001
|
-
if (isOwn) {
|
|
5002
|
-
value[symToStringTag$1] = tag;
|
|
5003
|
-
} else {
|
|
5004
|
-
delete value[symToStringTag$1];
|
|
5005
|
-
}
|
|
5006
|
-
}
|
|
5007
|
-
return result;
|
|
5008
|
-
}
|
|
5009
|
-
|
|
5010
|
-
var _getRawTag = getRawTag$1;
|
|
5011
|
-
|
|
5012
|
-
/** Used for built-in method references. */
|
|
5013
|
-
|
|
5014
|
-
var objectProto$1 = Object.prototype;
|
|
5015
|
-
|
|
5016
|
-
/**
|
|
5017
|
-
* Used to resolve the
|
|
5018
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
5019
|
-
* of values.
|
|
5020
|
-
*/
|
|
5021
|
-
var nativeObjectToString = objectProto$1.toString;
|
|
5022
|
-
|
|
5023
|
-
/**
|
|
5024
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
5025
|
-
*
|
|
5026
|
-
* @private
|
|
5027
|
-
* @param {*} value The value to convert.
|
|
5028
|
-
* @returns {string} Returns the converted string.
|
|
5029
|
-
*/
|
|
5030
|
-
function objectToString$1(value) {
|
|
5031
|
-
return nativeObjectToString.call(value);
|
|
5032
|
-
}
|
|
5033
|
-
|
|
5034
|
-
var _objectToString = objectToString$1;
|
|
5035
|
-
|
|
5036
|
-
var Symbol$1 = _Symbol,
|
|
5037
|
-
getRawTag = _getRawTag,
|
|
5038
|
-
objectToString = _objectToString;
|
|
5039
|
-
|
|
5040
|
-
/** `Object#toString` result references. */
|
|
5041
|
-
var nullTag = '[object Null]',
|
|
5042
|
-
undefinedTag = '[object Undefined]';
|
|
5043
|
-
|
|
5044
|
-
/** Built-in value references. */
|
|
5045
|
-
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
5046
|
-
|
|
5047
|
-
/**
|
|
5048
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
5049
|
-
*
|
|
5050
|
-
* @private
|
|
5051
|
-
* @param {*} value The value to query.
|
|
5052
|
-
* @returns {string} Returns the `toStringTag`.
|
|
5053
|
-
*/
|
|
5054
|
-
function baseGetTag$1(value) {
|
|
5055
|
-
if (value == null) {
|
|
5056
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
5057
|
-
}
|
|
5058
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
5059
|
-
? getRawTag(value)
|
|
5060
|
-
: objectToString(value);
|
|
5426
|
+
|
|
5427
|
+
var boolean = {};
|
|
5428
|
+
|
|
5429
|
+
boolean.isntBoolean = boolean.isBoolean = void 0;
|
|
5430
|
+
function isBoolean(val) {
|
|
5431
|
+
return typeof val === 'boolean';
|
|
5432
|
+
}
|
|
5433
|
+
boolean.isBoolean = isBoolean;
|
|
5434
|
+
function isntBoolean(val) {
|
|
5435
|
+
return !isBoolean(val);
|
|
5061
5436
|
}
|
|
5437
|
+
boolean.isntBoolean = isntBoolean;
|
|
5062
5438
|
|
|
5063
|
-
var
|
|
5439
|
+
var char = {};
|
|
5064
5440
|
|
|
5065
|
-
|
|
5066
|
-
* Creates a unary function that invokes `func` with its argument transformed.
|
|
5067
|
-
*
|
|
5068
|
-
* @private
|
|
5069
|
-
* @param {Function} func The function to wrap.
|
|
5070
|
-
* @param {Function} transform The argument transform.
|
|
5071
|
-
* @returns {Function} Returns the new function.
|
|
5072
|
-
*/
|
|
5441
|
+
var string = {};
|
|
5073
5442
|
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
return
|
|
5077
|
-
};
|
|
5443
|
+
string.isntString = string.isString = void 0;
|
|
5444
|
+
function isString(val) {
|
|
5445
|
+
return typeof val === 'string';
|
|
5078
5446
|
}
|
|
5447
|
+
string.isString = isString;
|
|
5448
|
+
function isntString(val) {
|
|
5449
|
+
return !isString(val);
|
|
5450
|
+
}
|
|
5451
|
+
string.isntString = isntString;
|
|
5079
5452
|
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5453
|
+
char.isntChar = char.isChar = void 0;
|
|
5454
|
+
const string_1$1 = string;
|
|
5455
|
+
function isChar(val) {
|
|
5456
|
+
return (0, string_1$1.isString)(val)
|
|
5457
|
+
&& val.length === 1;
|
|
5458
|
+
}
|
|
5459
|
+
char.isChar = isChar;
|
|
5460
|
+
function isntChar(val) {
|
|
5461
|
+
return !isChar(val);
|
|
5462
|
+
}
|
|
5463
|
+
char.isntChar = isntChar;
|
|
5083
5464
|
|
|
5084
|
-
|
|
5085
|
-
var getPrototype$1 = overArg(Object.getPrototypeOf, Object);
|
|
5465
|
+
var date = {};
|
|
5086
5466
|
|
|
5087
|
-
|
|
5467
|
+
date.isntDate = date.isDate = void 0;
|
|
5468
|
+
function isDate(val) {
|
|
5469
|
+
return val instanceof Date;
|
|
5470
|
+
}
|
|
5471
|
+
date.isDate = isDate;
|
|
5472
|
+
function isntDate(val) {
|
|
5473
|
+
return !isDate(val);
|
|
5474
|
+
}
|
|
5475
|
+
date.isntDate = isntDate;
|
|
5088
5476
|
|
|
5089
|
-
|
|
5090
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
5091
|
-
* and has a `typeof` result of "object".
|
|
5092
|
-
*
|
|
5093
|
-
* @static
|
|
5094
|
-
* @memberOf _
|
|
5095
|
-
* @since 4.0.0
|
|
5096
|
-
* @category Lang
|
|
5097
|
-
* @param {*} value The value to check.
|
|
5098
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
5099
|
-
* @example
|
|
5100
|
-
*
|
|
5101
|
-
* _.isObjectLike({});
|
|
5102
|
-
* // => true
|
|
5103
|
-
*
|
|
5104
|
-
* _.isObjectLike([1, 2, 3]);
|
|
5105
|
-
* // => true
|
|
5106
|
-
*
|
|
5107
|
-
* _.isObjectLike(_.noop);
|
|
5108
|
-
* // => false
|
|
5109
|
-
*
|
|
5110
|
-
* _.isObjectLike(null);
|
|
5111
|
-
* // => false
|
|
5112
|
-
*/
|
|
5477
|
+
var _enum = {};
|
|
5113
5478
|
|
|
5114
|
-
|
|
5115
|
-
|
|
5479
|
+
_enum.inEnum = void 0;
|
|
5480
|
+
function inEnum(val, _enum) {
|
|
5481
|
+
return Object.values(_enum).includes(val);
|
|
5116
5482
|
}
|
|
5483
|
+
_enum.inEnum = inEnum;
|
|
5117
5484
|
|
|
5118
|
-
var
|
|
5485
|
+
var error = {};
|
|
5119
5486
|
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5487
|
+
error.isntError = error.isError = void 0;
|
|
5488
|
+
function isError(val) {
|
|
5489
|
+
return val instanceof Error;
|
|
5490
|
+
}
|
|
5491
|
+
error.isError = isError;
|
|
5492
|
+
function isntError(val) {
|
|
5493
|
+
return !isError(val);
|
|
5494
|
+
}
|
|
5495
|
+
error.isntError = isntError;
|
|
5123
5496
|
|
|
5124
|
-
|
|
5125
|
-
var objectTag = '[object Object]';
|
|
5497
|
+
var falsy = {};
|
|
5126
5498
|
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5499
|
+
falsy.isntFalsy = falsy.isFalsy = void 0;
|
|
5500
|
+
function isFalsy(val) {
|
|
5501
|
+
return !val;
|
|
5502
|
+
}
|
|
5503
|
+
falsy.isFalsy = isFalsy;
|
|
5504
|
+
function isntFalsy(val) {
|
|
5505
|
+
return !isFalsy(val);
|
|
5506
|
+
}
|
|
5507
|
+
falsy.isntFalsy = isntFalsy;
|
|
5130
5508
|
|
|
5131
|
-
|
|
5132
|
-
var funcToString = funcProto.toString;
|
|
5509
|
+
var iterable = {};
|
|
5133
5510
|
|
|
5134
|
-
|
|
5135
|
-
|
|
5511
|
+
iterable.isntIterable = iterable.isIterable = void 0;
|
|
5512
|
+
const null_1$1 = _null;
|
|
5513
|
+
const undefined_1 = _undefined;
|
|
5514
|
+
const function_1$1 = _function;
|
|
5515
|
+
function isIterable(val) {
|
|
5516
|
+
return (0, null_1$1.isntNull)(val)
|
|
5517
|
+
&& (0, undefined_1.isntUndefined)(val)
|
|
5518
|
+
&& (0, function_1$1.isFunction)(val[Symbol.iterator]);
|
|
5519
|
+
}
|
|
5520
|
+
iterable.isIterable = isIterable;
|
|
5521
|
+
function isntIterable(val) {
|
|
5522
|
+
return !isIterable(val);
|
|
5523
|
+
}
|
|
5524
|
+
iterable.isntIterable = isntIterable;
|
|
5136
5525
|
|
|
5137
|
-
|
|
5138
|
-
var objectCtorString = funcToString.call(Object);
|
|
5526
|
+
var json = {};
|
|
5139
5527
|
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
5170
|
-
return false;
|
|
5171
|
-
}
|
|
5172
|
-
var proto = getPrototype(value);
|
|
5173
|
-
if (proto === null) {
|
|
5174
|
-
return true;
|
|
5175
|
-
}
|
|
5176
|
-
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
5177
|
-
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
5178
|
-
funcToString.call(Ctor) == objectCtorString;
|
|
5528
|
+
var number = {};
|
|
5529
|
+
|
|
5530
|
+
number.isntNaN = number.isNaN = number.isNegativeInfinity = number.isPositiveInfinity = number.isFinite = number.isntNumber = number.isNumber = void 0;
|
|
5531
|
+
function isNumber(val) {
|
|
5532
|
+
return typeof val === 'number';
|
|
5533
|
+
}
|
|
5534
|
+
number.isNumber = isNumber;
|
|
5535
|
+
function isntNumber(val) {
|
|
5536
|
+
return !isNumber(val);
|
|
5537
|
+
}
|
|
5538
|
+
number.isntNumber = isntNumber;
|
|
5539
|
+
function isFinite(val) {
|
|
5540
|
+
return Number.isFinite(val);
|
|
5541
|
+
}
|
|
5542
|
+
number.isFinite = isFinite;
|
|
5543
|
+
function isPositiveInfinity(val) {
|
|
5544
|
+
return val === Infinity;
|
|
5545
|
+
}
|
|
5546
|
+
number.isPositiveInfinity = isPositiveInfinity;
|
|
5547
|
+
function isNegativeInfinity(val) {
|
|
5548
|
+
return val === -Infinity;
|
|
5549
|
+
}
|
|
5550
|
+
number.isNegativeInfinity = isNegativeInfinity;
|
|
5551
|
+
function isNaN(val) {
|
|
5552
|
+
return Number.isNaN(val);
|
|
5553
|
+
}
|
|
5554
|
+
number.isNaN = isNaN;
|
|
5555
|
+
function isntNaN(val) {
|
|
5556
|
+
return !isNaN(val);
|
|
5179
5557
|
}
|
|
5558
|
+
number.isntNaN = isntNaN;
|
|
5180
5559
|
|
|
5181
|
-
var
|
|
5560
|
+
var object = {};
|
|
5182
5561
|
|
|
5183
5562
|
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
5184
5563
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5185
5564
|
};object.isntEmptyObject = object.isEmptyObject = object.isntPlainObject = object.isPlainObject = object.isntObject = object.isObject = void 0;
|
|
5186
|
-
const isPlainObject_1 = __importDefault(isPlainObject_1$
|
|
5565
|
+
const isPlainObject_1 = __importDefault(isPlainObject_1$2);
|
|
5187
5566
|
function isObject(val) {
|
|
5188
5567
|
return val !== null
|
|
5189
5568
|
&& typeof val === 'object';
|
|
@@ -7569,7 +7948,7 @@
|
|
|
7569
7948
|
function* dfs(node, paths) {
|
|
7570
7949
|
for (const [path, childNode] of node.children) {
|
|
7571
7950
|
const newPaths = [...paths, path];
|
|
7572
|
-
if (es2018$
|
|
7951
|
+
if (es2018$e.isntUndefined(childNode.value)) {
|
|
7573
7952
|
yield [newPaths, childNode.value];
|
|
7574
7953
|
}
|
|
7575
7954
|
yield* dfs(childNode, newPaths);
|
|
@@ -7647,6 +8026,9 @@
|
|
|
7647
8026
|
this.schema = schema;
|
|
7648
8027
|
this._state = initialState;
|
|
7649
8028
|
}
|
|
8029
|
+
get [Symbol.toStringTag]() {
|
|
8030
|
+
return this.constructor.name;
|
|
8031
|
+
}
|
|
7650
8032
|
get state() {
|
|
7651
8033
|
return this._state;
|
|
7652
8034
|
}
|
|
@@ -9245,6 +9627,9 @@
|
|
|
9245
9627
|
super(...arguments);
|
|
9246
9628
|
this.stateChanges = new Subject();
|
|
9247
9629
|
}
|
|
9630
|
+
get [Symbol.toStringTag]() {
|
|
9631
|
+
return this.constructor.name;
|
|
9632
|
+
}
|
|
9248
9633
|
observeStateChanges() {
|
|
9249
9634
|
return this.stateChanges;
|
|
9250
9635
|
}
|
|
@@ -9256,7 +9641,7 @@
|
|
|
9256
9641
|
super.send(event);
|
|
9257
9642
|
const newState = this.state;
|
|
9258
9643
|
this.stateChanges.next({ event, oldState, newState });
|
|
9259
|
-
if (es2018$
|
|
9644
|
+
if (es2018$e.isEmptyObject(this.schema[newState])) {
|
|
9260
9645
|
this.stateChanges.complete();
|
|
9261
9646
|
}
|
|
9262
9647
|
}
|
|
@@ -9267,6 +9652,9 @@
|
|
|
9267
9652
|
this.values = [];
|
|
9268
9653
|
this.valueToValueIndex = [];
|
|
9269
9654
|
}
|
|
9655
|
+
get [Symbol.toStringTag]() {
|
|
9656
|
+
return this.constructor.name;
|
|
9657
|
+
}
|
|
9270
9658
|
*[Symbol.iterator]() {
|
|
9271
9659
|
for (const value of this.values) {
|
|
9272
9660
|
yield value;
|
|
@@ -9274,7 +9662,7 @@
|
|
|
9274
9662
|
}
|
|
9275
9663
|
has(value) {
|
|
9276
9664
|
// 跟一般的实现不同, 不需要访问values数组.
|
|
9277
|
-
return es2018$
|
|
9665
|
+
return es2018$e.isntUndefined(this.valueToValueIndex[value]);
|
|
9278
9666
|
}
|
|
9279
9667
|
add(value) {
|
|
9280
9668
|
if (!this.has(value)) {
|
|
@@ -9297,8 +9685,129 @@
|
|
|
9297
9685
|
}
|
|
9298
9686
|
}
|
|
9299
9687
|
|
|
9688
|
+
// 相关提案: https://github.com/tc39/proposal-resizablearraybuffer
|
|
9689
|
+
class DynamicTypedArray {
|
|
9690
|
+
constructor(typedArrayConstructor, { capacity = 0, growthFactor = 1.5 } = {}) {
|
|
9691
|
+
this.typedArrayConstructor = typedArrayConstructor;
|
|
9692
|
+
this._length = 0;
|
|
9693
|
+
es2018$d.assert(Number.isInteger(capacity), 'capacity must be an integer');
|
|
9694
|
+
es2018$d.assert(capacity >= 0, 'capacity must be greater than or equal to 0');
|
|
9695
|
+
es2018$d.assert(growthFactor > 1, 'growthFactory must be greater than or equal to 1');
|
|
9696
|
+
this.array = new typedArrayConstructor(capacity);
|
|
9697
|
+
this.growthFactor = growthFactor;
|
|
9698
|
+
}
|
|
9699
|
+
get internalTypedArray() {
|
|
9700
|
+
return this.array;
|
|
9701
|
+
}
|
|
9702
|
+
get [Symbol.toStringTag]() {
|
|
9703
|
+
return this.constructor.name;
|
|
9704
|
+
}
|
|
9705
|
+
/**
|
|
9706
|
+
* 数组当前的容量.
|
|
9707
|
+
*/
|
|
9708
|
+
get capacity() {
|
|
9709
|
+
return this.array.length;
|
|
9710
|
+
}
|
|
9711
|
+
/**
|
|
9712
|
+
* 数组逻辑上的长度, 总是小于或等于capacity.
|
|
9713
|
+
*/
|
|
9714
|
+
get length() {
|
|
9715
|
+
return this._length;
|
|
9716
|
+
}
|
|
9717
|
+
set(index, value) {
|
|
9718
|
+
if (index >= this.capacity) {
|
|
9719
|
+
const newCapacity = computeNewCapacity(this.capacity, index + 1, this.growthFactor);
|
|
9720
|
+
this.resize(newCapacity);
|
|
9721
|
+
}
|
|
9722
|
+
if (index >= this._length) {
|
|
9723
|
+
this._length = index + 1;
|
|
9724
|
+
}
|
|
9725
|
+
this.array[index] = value;
|
|
9726
|
+
}
|
|
9727
|
+
get(index) {
|
|
9728
|
+
return index < this._length
|
|
9729
|
+
? this.array[index]
|
|
9730
|
+
: undefined;
|
|
9731
|
+
}
|
|
9732
|
+
push(...values) {
|
|
9733
|
+
const newLength = this._length + values.length;
|
|
9734
|
+
if (newLength > this.capacity) {
|
|
9735
|
+
const newCapacity = computeNewCapacity(this.capacity, newLength, this.growthFactor);
|
|
9736
|
+
this.resize(newCapacity);
|
|
9737
|
+
}
|
|
9738
|
+
for (const value of values) {
|
|
9739
|
+
this.array[this._length++] = value;
|
|
9740
|
+
}
|
|
9741
|
+
}
|
|
9742
|
+
pop() {
|
|
9743
|
+
if (this._length > 0) {
|
|
9744
|
+
const value = this.array[this._length - 1];
|
|
9745
|
+
this._length--;
|
|
9746
|
+
const newCapacity = computeNewCapacity(this.capacity, this.length, this.growthFactor);
|
|
9747
|
+
this.resize(newCapacity);
|
|
9748
|
+
return value;
|
|
9749
|
+
}
|
|
9750
|
+
else {
|
|
9751
|
+
return undefined;
|
|
9752
|
+
}
|
|
9753
|
+
}
|
|
9754
|
+
resize(newCapacity) {
|
|
9755
|
+
if (this.array.length === newCapacity) {
|
|
9756
|
+
return;
|
|
9757
|
+
}
|
|
9758
|
+
else if (this.array.length < newCapacity) {
|
|
9759
|
+
const newArray = new this.typedArrayConstructor(newCapacity);
|
|
9760
|
+
newArray.set(this.array);
|
|
9761
|
+
this.array = newArray;
|
|
9762
|
+
}
|
|
9763
|
+
else if (this.array.length > newCapacity) {
|
|
9764
|
+
const newArray = new this.typedArrayConstructor(newCapacity);
|
|
9765
|
+
// 不需要的部分将被舍弃.
|
|
9766
|
+
for (let i = newCapacity; i--;) {
|
|
9767
|
+
newArray[i] = this.array[i];
|
|
9768
|
+
}
|
|
9769
|
+
this.array = newArray;
|
|
9770
|
+
}
|
|
9771
|
+
}
|
|
9772
|
+
}
|
|
9773
|
+
function computeNewCapacity(oldCapacity, targetLength, growthFactor) {
|
|
9774
|
+
if (oldCapacity === targetLength) {
|
|
9775
|
+
return targetLength;
|
|
9776
|
+
}
|
|
9777
|
+
else if (oldCapacity < targetLength) {
|
|
9778
|
+
// 增加容量以适配targetLength
|
|
9779
|
+
let newCapacity = Math.max(oldCapacity, 1);
|
|
9780
|
+
while (newCapacity < targetLength) {
|
|
9781
|
+
newCapacity *= growthFactor;
|
|
9782
|
+
}
|
|
9783
|
+
return Math.floor(newCapacity);
|
|
9784
|
+
}
|
|
9785
|
+
else {
|
|
9786
|
+
// 尝试减少容量以适配targetLength
|
|
9787
|
+
// `targetLength = 0`是特殊情况,
|
|
9788
|
+
// 此时无论怎么将oldCapacity除以growthFactory几次, 都不可能得到比targetLength小的结果.
|
|
9789
|
+
if (targetLength === 0) {
|
|
9790
|
+
return 0;
|
|
9791
|
+
}
|
|
9792
|
+
else {
|
|
9793
|
+
let newCapacity = oldCapacity;
|
|
9794
|
+
while (true) {
|
|
9795
|
+
const temp = newCapacity / growthFactor;
|
|
9796
|
+
if (temp < targetLength) {
|
|
9797
|
+
break;
|
|
9798
|
+
}
|
|
9799
|
+
else {
|
|
9800
|
+
newCapacity = temp;
|
|
9801
|
+
}
|
|
9802
|
+
}
|
|
9803
|
+
return Math.floor(newCapacity);
|
|
9804
|
+
}
|
|
9805
|
+
}
|
|
9806
|
+
}
|
|
9807
|
+
|
|
9300
9808
|
exports.BadEventError = BadEventError;
|
|
9301
9809
|
exports.Box = Box;
|
|
9810
|
+
exports.DynamicTypedArray = DynamicTypedArray;
|
|
9302
9811
|
exports.Emitter = Emitter;
|
|
9303
9812
|
exports.ExpirableMap = ExpirableMap;
|
|
9304
9813
|
exports.FiniteStateMachine = FiniteStateMachine;
|