@blackglory/structures 0.11.4 → 0.11.5
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 +78 -2
- package/lib/es2015/big-map.d.ts +14 -0
- package/lib/es2015/big-map.js +86 -0
- package/lib/es2015/big-map.js.map +1 -0
- package/lib/es2015/big-set.d.ts +11 -0
- package/lib/es2015/big-set.js +64 -0
- package/lib/es2015/big-set.js.map +1 -0
- package/lib/es2015/box.js +3 -3
- package/lib/es2015/box.js.map +1 -1
- package/lib/es2015/dynamic-typed-array.js +9 -9
- package/lib/es2015/dynamic-typed-array.js.map +1 -1
- package/lib/es2015/emitter.d.ts +1 -1
- package/lib/es2015/hash-map.js +4 -4
- package/lib/es2015/hash-map.js.map +1 -1
- package/lib/es2015/hash-set.js +4 -4
- package/lib/es2015/hash-set.js.map +1 -1
- package/lib/es2015/index.d.ts +2 -0
- package/lib/es2015/index.js +2 -0
- package/lib/es2015/index.js.map +1 -1
- package/lib/es2015/lru-map.js +6 -6
- package/lib/es2015/lru-map.js.map +1 -1
- package/lib/es2015/sorted-set.js +3 -3
- package/lib/es2015/sorted-set.js.map +1 -1
- package/lib/es2015/sparse-set.js +6 -6
- package/lib/es2015/sparse-set.js.map +1 -1
- package/lib/es2015/tlru-map.js +6 -6
- package/lib/es2015/tlru-map.js.map +1 -1
- package/lib/es2015/typed-sparse-map.js +6 -6
- package/lib/es2015/typed-sparse-map.js.map +1 -1
- package/lib/es2015/utils/skip-list.js +3 -3
- package/lib/es2015/utils/skip-list.js.map +1 -1
- package/lib/es2018/big-map.d.ts +14 -0
- package/lib/es2018/big-map.js +86 -0
- package/lib/es2018/big-map.js.map +1 -0
- package/lib/es2018/big-set.d.ts +11 -0
- package/lib/es2018/big-set.js +64 -0
- package/lib/es2018/big-set.js.map +1 -0
- package/lib/es2018/box.js +3 -3
- package/lib/es2018/box.js.map +1 -1
- package/lib/es2018/dynamic-typed-array.js +9 -9
- package/lib/es2018/dynamic-typed-array.js.map +1 -1
- package/lib/es2018/emitter.d.ts +1 -1
- package/lib/es2018/hash-map.js +4 -4
- package/lib/es2018/hash-map.js.map +1 -1
- package/lib/es2018/hash-set.js +4 -4
- package/lib/es2018/hash-set.js.map +1 -1
- package/lib/es2018/index.d.ts +2 -0
- package/lib/es2018/index.js +2 -0
- package/lib/es2018/index.js.map +1 -1
- package/lib/es2018/lru-map.js +6 -6
- package/lib/es2018/lru-map.js.map +1 -1
- package/lib/es2018/sorted-set.js +3 -3
- package/lib/es2018/sorted-set.js.map +1 -1
- package/lib/es2018/sparse-set.js +6 -6
- package/lib/es2018/sparse-set.js.map +1 -1
- package/lib/es2018/tlru-map.js +6 -6
- package/lib/es2018/tlru-map.js.map +1 -1
- package/lib/es2018/typed-sparse-map.js +6 -6
- package/lib/es2018/typed-sparse-map.js.map +1 -1
- package/lib/es2018/utils/skip-list.js +3 -3
- package/lib/es2018/utils/skip-list.js.map +1 -1
- package/package.json +15 -16
- package/dist/es2015/index.min.mjs +0 -2
- package/dist/es2015/index.min.mjs.map +0 -1
- package/dist/es2015/index.mjs +0 -4814
- package/dist/es2015/index.mjs.map +0 -1
- package/dist/es2015/index.umd.js +0 -4846
- package/dist/es2015/index.umd.js.map +0 -1
- package/dist/es2015/index.umd.min.js +0 -2
- package/dist/es2015/index.umd.min.js.map +0 -1
- package/dist/es2018/index.min.mjs +0 -2
- package/dist/es2018/index.min.mjs.map +0 -1
- package/dist/es2018/index.mjs +0 -4814
- package/dist/es2018/index.mjs.map +0 -1
- package/dist/es2018/index.umd.js +0 -4846
- package/dist/es2018/index.umd.js.map +0 -1
- package/dist/es2018/index.umd.min.js +0 -2
- package/dist/es2018/index.umd.min.js.map +0 -1
package/dist/es2015/index.mjs
DELETED
|
@@ -1,4814 +0,0 @@
|
|
|
1
|
-
class Box {
|
|
2
|
-
constructor(value) {
|
|
3
|
-
this.value = value;
|
|
4
|
-
}
|
|
5
|
-
get [Symbol.toStringTag]() {
|
|
6
|
-
return this.constructor.name;
|
|
7
|
-
}
|
|
8
|
-
set(value) {
|
|
9
|
-
this.value = value;
|
|
10
|
-
}
|
|
11
|
-
get() {
|
|
12
|
-
return this.value;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
17
|
-
|
|
18
|
-
var es2018$7 = {};
|
|
19
|
-
|
|
20
|
-
var array$1 = {};
|
|
21
|
-
|
|
22
|
-
array$1.isntEmptyArray = array$1.isEmptyArray = array$1.isntArray = array$1.isArray = void 0;
|
|
23
|
-
function isArray$1(val) {
|
|
24
|
-
return Array.isArray(val);
|
|
25
|
-
}
|
|
26
|
-
array$1.isArray = isArray$1;
|
|
27
|
-
function isntArray$1(val) {
|
|
28
|
-
return !isArray$1(val);
|
|
29
|
-
}
|
|
30
|
-
array$1.isntArray = isntArray$1;
|
|
31
|
-
function isEmptyArray$1(val) {
|
|
32
|
-
return val.length === 0;
|
|
33
|
-
}
|
|
34
|
-
array$1.isEmptyArray = isEmptyArray$1;
|
|
35
|
-
function isntEmptyArray$1(val) {
|
|
36
|
-
return val.length !== 0;
|
|
37
|
-
}
|
|
38
|
-
array$1.isntEmptyArray = isntEmptyArray$1;
|
|
39
|
-
|
|
40
|
-
var asyncIterable$1 = {};
|
|
41
|
-
|
|
42
|
-
var _null$1 = {};
|
|
43
|
-
|
|
44
|
-
_null$1.isntNull = _null$1.isNull = void 0;
|
|
45
|
-
function isNull$1(val) {
|
|
46
|
-
return val === null;
|
|
47
|
-
}
|
|
48
|
-
_null$1.isNull = isNull$1;
|
|
49
|
-
function isntNull$1(val) {
|
|
50
|
-
return !isNull$1(val);
|
|
51
|
-
}
|
|
52
|
-
_null$1.isntNull = isntNull$1;
|
|
53
|
-
|
|
54
|
-
var _undefined$1 = {};
|
|
55
|
-
|
|
56
|
-
_undefined$1.isntUndefined = _undefined$1.isUndefined = void 0;
|
|
57
|
-
function isUndefined$1(val) {
|
|
58
|
-
return val === undefined;
|
|
59
|
-
}
|
|
60
|
-
_undefined$1.isUndefined = isUndefined$1;
|
|
61
|
-
function isntUndefined$1(val) {
|
|
62
|
-
return !isUndefined$1(val);
|
|
63
|
-
}
|
|
64
|
-
_undefined$1.isntUndefined = isntUndefined$1;
|
|
65
|
-
|
|
66
|
-
var _function$1 = {};
|
|
67
|
-
|
|
68
|
-
_function$1.isntFunction = _function$1.isFunction = void 0;
|
|
69
|
-
function isFunction$1(val) {
|
|
70
|
-
return typeof val === 'function';
|
|
71
|
-
}
|
|
72
|
-
_function$1.isFunction = isFunction$1;
|
|
73
|
-
function isntFunction$1(val) {
|
|
74
|
-
return !isFunction$1(val);
|
|
75
|
-
}
|
|
76
|
-
_function$1.isntFunction = isntFunction$1;
|
|
77
|
-
|
|
78
|
-
asyncIterable$1.isntAsyncIterable = asyncIterable$1.isAsyncIterable = void 0;
|
|
79
|
-
const null_1$5 = _null$1;
|
|
80
|
-
const undefined_1$3 = _undefined$1;
|
|
81
|
-
const function_1$5 = _function$1;
|
|
82
|
-
function isAsyncIterable$1(val) {
|
|
83
|
-
return (0, null_1$5.isntNull)(val)
|
|
84
|
-
&& (0, undefined_1$3.isntUndefined)(val)
|
|
85
|
-
&& (0, function_1$5.isFunction)(val[Symbol.asyncIterator]);
|
|
86
|
-
}
|
|
87
|
-
asyncIterable$1.isAsyncIterable = isAsyncIterable$1;
|
|
88
|
-
function isntAsyncIterable$1(val) {
|
|
89
|
-
return !isAsyncIterable$1(val);
|
|
90
|
-
}
|
|
91
|
-
asyncIterable$1.isntAsyncIterable = isntAsyncIterable$1;
|
|
92
|
-
|
|
93
|
-
var bigint$1 = {};
|
|
94
|
-
|
|
95
|
-
bigint$1.isntBigInt = bigint$1.isBigInt = void 0;
|
|
96
|
-
function isBigInt$1(val) {
|
|
97
|
-
return typeof val === 'bigint';
|
|
98
|
-
}
|
|
99
|
-
bigint$1.isBigInt = isBigInt$1;
|
|
100
|
-
function isntBigInt$1(val) {
|
|
101
|
-
return !isBigInt$1(val);
|
|
102
|
-
}
|
|
103
|
-
bigint$1.isntBigInt = isntBigInt$1;
|
|
104
|
-
|
|
105
|
-
var boolean$1 = {};
|
|
106
|
-
|
|
107
|
-
boolean$1.isntBoolean = boolean$1.isBoolean = void 0;
|
|
108
|
-
function isBoolean$1(val) {
|
|
109
|
-
return typeof val === 'boolean';
|
|
110
|
-
}
|
|
111
|
-
boolean$1.isBoolean = isBoolean$1;
|
|
112
|
-
function isntBoolean$1(val) {
|
|
113
|
-
return !isBoolean$1(val);
|
|
114
|
-
}
|
|
115
|
-
boolean$1.isntBoolean = isntBoolean$1;
|
|
116
|
-
|
|
117
|
-
var char$1 = {};
|
|
118
|
-
|
|
119
|
-
var string$1 = {};
|
|
120
|
-
|
|
121
|
-
string$1.isntString = string$1.isString = void 0;
|
|
122
|
-
function isString$1(val) {
|
|
123
|
-
return typeof val === 'string';
|
|
124
|
-
}
|
|
125
|
-
string$1.isString = isString$1;
|
|
126
|
-
function isntString$1(val) {
|
|
127
|
-
return !isString$1(val);
|
|
128
|
-
}
|
|
129
|
-
string$1.isntString = isntString$1;
|
|
130
|
-
|
|
131
|
-
char$1.isntChar = char$1.isChar = void 0;
|
|
132
|
-
const string_1$3 = string$1;
|
|
133
|
-
function isChar$1(val) {
|
|
134
|
-
return (0, string_1$3.isString)(val)
|
|
135
|
-
&& val.length === 1;
|
|
136
|
-
}
|
|
137
|
-
char$1.isChar = isChar$1;
|
|
138
|
-
function isntChar$1(val) {
|
|
139
|
-
return !isChar$1(val);
|
|
140
|
-
}
|
|
141
|
-
char$1.isntChar = isntChar$1;
|
|
142
|
-
|
|
143
|
-
var date$1 = {};
|
|
144
|
-
|
|
145
|
-
date$1.isntDate = date$1.isDate = void 0;
|
|
146
|
-
function isDate$1(val) {
|
|
147
|
-
return val instanceof Date;
|
|
148
|
-
}
|
|
149
|
-
date$1.isDate = isDate$1;
|
|
150
|
-
function isntDate$1(val) {
|
|
151
|
-
return !isDate$1(val);
|
|
152
|
-
}
|
|
153
|
-
date$1.isntDate = isntDate$1;
|
|
154
|
-
|
|
155
|
-
var _enum$1 = {};
|
|
156
|
-
|
|
157
|
-
_enum$1.inEnum = void 0;
|
|
158
|
-
function inEnum$1(val, _enum) {
|
|
159
|
-
return Object.values(_enum).includes(val);
|
|
160
|
-
}
|
|
161
|
-
_enum$1.inEnum = inEnum$1;
|
|
162
|
-
|
|
163
|
-
var error$1 = {};
|
|
164
|
-
|
|
165
|
-
error$1.isntError = error$1.isError = void 0;
|
|
166
|
-
function isError$1(val) {
|
|
167
|
-
return val instanceof Error;
|
|
168
|
-
}
|
|
169
|
-
error$1.isError = isError$1;
|
|
170
|
-
function isntError$1(val) {
|
|
171
|
-
return !isError$1(val);
|
|
172
|
-
}
|
|
173
|
-
error$1.isntError = isntError$1;
|
|
174
|
-
|
|
175
|
-
var falsy$1 = {};
|
|
176
|
-
|
|
177
|
-
falsy$1.isntFalsy = falsy$1.isFalsy = void 0;
|
|
178
|
-
function isFalsy$1(val) {
|
|
179
|
-
return !val;
|
|
180
|
-
}
|
|
181
|
-
falsy$1.isFalsy = isFalsy$1;
|
|
182
|
-
function isntFalsy$1(val) {
|
|
183
|
-
return !isFalsy$1(val);
|
|
184
|
-
}
|
|
185
|
-
falsy$1.isntFalsy = isntFalsy$1;
|
|
186
|
-
|
|
187
|
-
var iterable$1 = {};
|
|
188
|
-
|
|
189
|
-
iterable$1.isntIterable = iterable$1.isIterable = void 0;
|
|
190
|
-
const null_1$4 = _null$1;
|
|
191
|
-
const undefined_1$2 = _undefined$1;
|
|
192
|
-
const function_1$4 = _function$1;
|
|
193
|
-
function isIterable$1(val) {
|
|
194
|
-
return (0, null_1$4.isntNull)(val)
|
|
195
|
-
&& (0, undefined_1$2.isntUndefined)(val)
|
|
196
|
-
&& (0, function_1$4.isFunction)(val[Symbol.iterator]);
|
|
197
|
-
}
|
|
198
|
-
iterable$1.isIterable = isIterable$1;
|
|
199
|
-
function isntIterable$1(val) {
|
|
200
|
-
return !isIterable$1(val);
|
|
201
|
-
}
|
|
202
|
-
iterable$1.isntIterable = isntIterable$1;
|
|
203
|
-
|
|
204
|
-
var json$1 = {};
|
|
205
|
-
|
|
206
|
-
var number$1 = {};
|
|
207
|
-
|
|
208
|
-
number$1.isntNaN = number$1.isNaN = number$1.isNegativeInfinity = number$1.isPositiveInfinity = number$1.isFinite = number$1.isntNumber = number$1.isNumber = void 0;
|
|
209
|
-
function isNumber$1(val) {
|
|
210
|
-
return typeof val === 'number';
|
|
211
|
-
}
|
|
212
|
-
number$1.isNumber = isNumber$1;
|
|
213
|
-
function isntNumber$1(val) {
|
|
214
|
-
return !isNumber$1(val);
|
|
215
|
-
}
|
|
216
|
-
number$1.isntNumber = isntNumber$1;
|
|
217
|
-
function isFinite$1(val) {
|
|
218
|
-
return Number.isFinite(val);
|
|
219
|
-
}
|
|
220
|
-
number$1.isFinite = isFinite$1;
|
|
221
|
-
function isPositiveInfinity$1(val) {
|
|
222
|
-
return val === Infinity;
|
|
223
|
-
}
|
|
224
|
-
number$1.isPositiveInfinity = isPositiveInfinity$1;
|
|
225
|
-
function isNegativeInfinity$1(val) {
|
|
226
|
-
return val === -Infinity;
|
|
227
|
-
}
|
|
228
|
-
number$1.isNegativeInfinity = isNegativeInfinity$1;
|
|
229
|
-
function isNaN$1(val) {
|
|
230
|
-
return Number.isNaN(val);
|
|
231
|
-
}
|
|
232
|
-
number$1.isNaN = isNaN$1;
|
|
233
|
-
function isntNaN$1(val) {
|
|
234
|
-
return !isNaN$1(val);
|
|
235
|
-
}
|
|
236
|
-
number$1.isntNaN = isntNaN$1;
|
|
237
|
-
|
|
238
|
-
var object$1 = {};
|
|
239
|
-
|
|
240
|
-
/** Detect free variable `global` from Node.js. */
|
|
241
|
-
|
|
242
|
-
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
243
|
-
|
|
244
|
-
var _freeGlobal = freeGlobal$1;
|
|
245
|
-
|
|
246
|
-
var freeGlobal = _freeGlobal;
|
|
247
|
-
|
|
248
|
-
/** Detect free variable `self`. */
|
|
249
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
250
|
-
|
|
251
|
-
/** Used as a reference to the global object. */
|
|
252
|
-
var root$1 = freeGlobal || freeSelf || Function('return this')();
|
|
253
|
-
|
|
254
|
-
var _root = root$1;
|
|
255
|
-
|
|
256
|
-
var root = _root;
|
|
257
|
-
|
|
258
|
-
/** Built-in value references. */
|
|
259
|
-
var Symbol$3 = root.Symbol;
|
|
260
|
-
|
|
261
|
-
var _Symbol = Symbol$3;
|
|
262
|
-
|
|
263
|
-
var Symbol$2 = _Symbol;
|
|
264
|
-
|
|
265
|
-
/** Used for built-in method references. */
|
|
266
|
-
var objectProto$2 = Object.prototype;
|
|
267
|
-
|
|
268
|
-
/** Used to check objects for own properties. */
|
|
269
|
-
var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Used to resolve the
|
|
273
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
274
|
-
* of values.
|
|
275
|
-
*/
|
|
276
|
-
var nativeObjectToString$1 = objectProto$2.toString;
|
|
277
|
-
|
|
278
|
-
/** Built-in value references. */
|
|
279
|
-
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
283
|
-
*
|
|
284
|
-
* @private
|
|
285
|
-
* @param {*} value The value to query.
|
|
286
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
287
|
-
*/
|
|
288
|
-
function getRawTag$1(value) {
|
|
289
|
-
var isOwn = hasOwnProperty$1.call(value, symToStringTag$1),
|
|
290
|
-
tag = value[symToStringTag$1];
|
|
291
|
-
|
|
292
|
-
try {
|
|
293
|
-
value[symToStringTag$1] = undefined;
|
|
294
|
-
var unmasked = true;
|
|
295
|
-
} catch (e) {}
|
|
296
|
-
|
|
297
|
-
var result = nativeObjectToString$1.call(value);
|
|
298
|
-
if (unmasked) {
|
|
299
|
-
if (isOwn) {
|
|
300
|
-
value[symToStringTag$1] = tag;
|
|
301
|
-
} else {
|
|
302
|
-
delete value[symToStringTag$1];
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
return result;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
var _getRawTag = getRawTag$1;
|
|
309
|
-
|
|
310
|
-
/** Used for built-in method references. */
|
|
311
|
-
|
|
312
|
-
var objectProto$1 = Object.prototype;
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Used to resolve the
|
|
316
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
317
|
-
* of values.
|
|
318
|
-
*/
|
|
319
|
-
var nativeObjectToString = objectProto$1.toString;
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
323
|
-
*
|
|
324
|
-
* @private
|
|
325
|
-
* @param {*} value The value to convert.
|
|
326
|
-
* @returns {string} Returns the converted string.
|
|
327
|
-
*/
|
|
328
|
-
function objectToString$1(value) {
|
|
329
|
-
return nativeObjectToString.call(value);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
var _objectToString = objectToString$1;
|
|
333
|
-
|
|
334
|
-
var Symbol$1 = _Symbol,
|
|
335
|
-
getRawTag = _getRawTag,
|
|
336
|
-
objectToString = _objectToString;
|
|
337
|
-
|
|
338
|
-
/** `Object#toString` result references. */
|
|
339
|
-
var nullTag = '[object Null]',
|
|
340
|
-
undefinedTag = '[object Undefined]';
|
|
341
|
-
|
|
342
|
-
/** Built-in value references. */
|
|
343
|
-
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
347
|
-
*
|
|
348
|
-
* @private
|
|
349
|
-
* @param {*} value The value to query.
|
|
350
|
-
* @returns {string} Returns the `toStringTag`.
|
|
351
|
-
*/
|
|
352
|
-
function baseGetTag$1(value) {
|
|
353
|
-
if (value == null) {
|
|
354
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
355
|
-
}
|
|
356
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
357
|
-
? getRawTag(value)
|
|
358
|
-
: objectToString(value);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
var _baseGetTag = baseGetTag$1;
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Creates a unary function that invokes `func` with its argument transformed.
|
|
365
|
-
*
|
|
366
|
-
* @private
|
|
367
|
-
* @param {Function} func The function to wrap.
|
|
368
|
-
* @param {Function} transform The argument transform.
|
|
369
|
-
* @returns {Function} Returns the new function.
|
|
370
|
-
*/
|
|
371
|
-
|
|
372
|
-
function overArg$1(func, transform) {
|
|
373
|
-
return function(arg) {
|
|
374
|
-
return func(transform(arg));
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
var _overArg = overArg$1;
|
|
379
|
-
|
|
380
|
-
var overArg = _overArg;
|
|
381
|
-
|
|
382
|
-
/** Built-in value references. */
|
|
383
|
-
var getPrototype$1 = overArg(Object.getPrototypeOf, Object);
|
|
384
|
-
|
|
385
|
-
var _getPrototype = getPrototype$1;
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
389
|
-
* and has a `typeof` result of "object".
|
|
390
|
-
*
|
|
391
|
-
* @static
|
|
392
|
-
* @memberOf _
|
|
393
|
-
* @since 4.0.0
|
|
394
|
-
* @category Lang
|
|
395
|
-
* @param {*} value The value to check.
|
|
396
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
397
|
-
* @example
|
|
398
|
-
*
|
|
399
|
-
* _.isObjectLike({});
|
|
400
|
-
* // => true
|
|
401
|
-
*
|
|
402
|
-
* _.isObjectLike([1, 2, 3]);
|
|
403
|
-
* // => true
|
|
404
|
-
*
|
|
405
|
-
* _.isObjectLike(_.noop);
|
|
406
|
-
* // => false
|
|
407
|
-
*
|
|
408
|
-
* _.isObjectLike(null);
|
|
409
|
-
* // => false
|
|
410
|
-
*/
|
|
411
|
-
|
|
412
|
-
function isObjectLike$1(value) {
|
|
413
|
-
return value != null && typeof value == 'object';
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
var isObjectLike_1 = isObjectLike$1;
|
|
417
|
-
|
|
418
|
-
var baseGetTag = _baseGetTag,
|
|
419
|
-
getPrototype = _getPrototype,
|
|
420
|
-
isObjectLike = isObjectLike_1;
|
|
421
|
-
|
|
422
|
-
/** `Object#toString` result references. */
|
|
423
|
-
var objectTag = '[object Object]';
|
|
424
|
-
|
|
425
|
-
/** Used for built-in method references. */
|
|
426
|
-
var funcProto = Function.prototype,
|
|
427
|
-
objectProto = Object.prototype;
|
|
428
|
-
|
|
429
|
-
/** Used to resolve the decompiled source of functions. */
|
|
430
|
-
var funcToString = funcProto.toString;
|
|
431
|
-
|
|
432
|
-
/** Used to check objects for own properties. */
|
|
433
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
434
|
-
|
|
435
|
-
/** Used to infer the `Object` constructor. */
|
|
436
|
-
var objectCtorString = funcToString.call(Object);
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* Checks if `value` is a plain object, that is, an object created by the
|
|
440
|
-
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
441
|
-
*
|
|
442
|
-
* @static
|
|
443
|
-
* @memberOf _
|
|
444
|
-
* @since 0.8.0
|
|
445
|
-
* @category Lang
|
|
446
|
-
* @param {*} value The value to check.
|
|
447
|
-
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
448
|
-
* @example
|
|
449
|
-
*
|
|
450
|
-
* function Foo() {
|
|
451
|
-
* this.a = 1;
|
|
452
|
-
* }
|
|
453
|
-
*
|
|
454
|
-
* _.isPlainObject(new Foo);
|
|
455
|
-
* // => false
|
|
456
|
-
*
|
|
457
|
-
* _.isPlainObject([1, 2, 3]);
|
|
458
|
-
* // => false
|
|
459
|
-
*
|
|
460
|
-
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
461
|
-
* // => true
|
|
462
|
-
*
|
|
463
|
-
* _.isPlainObject(Object.create(null));
|
|
464
|
-
* // => true
|
|
465
|
-
*/
|
|
466
|
-
function isPlainObject$2(value) {
|
|
467
|
-
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
468
|
-
return false;
|
|
469
|
-
}
|
|
470
|
-
var proto = getPrototype(value);
|
|
471
|
-
if (proto === null) {
|
|
472
|
-
return true;
|
|
473
|
-
}
|
|
474
|
-
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
475
|
-
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
476
|
-
funcToString.call(Ctor) == objectCtorString;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
var isPlainObject_1$2 = isPlainObject$2;
|
|
480
|
-
|
|
481
|
-
var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
482
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
483
|
-
};object$1.isntEmptyObject = object$1.isEmptyObject = object$1.isntPlainObject = object$1.isPlainObject = object$1.isntObject = object$1.isObject = void 0;
|
|
484
|
-
const isPlainObject_1$1 = __importDefault$1(isPlainObject_1$2);
|
|
485
|
-
function isObject$1(val) {
|
|
486
|
-
return val !== null
|
|
487
|
-
&& typeof val === 'object';
|
|
488
|
-
}
|
|
489
|
-
object$1.isObject = isObject$1;
|
|
490
|
-
function isntObject$1(val) {
|
|
491
|
-
return !isObject$1(val);
|
|
492
|
-
}
|
|
493
|
-
object$1.isntObject = isntObject$1;
|
|
494
|
-
function isPlainObject$1(val) {
|
|
495
|
-
return (0, isPlainObject_1$1.default)(val);
|
|
496
|
-
}
|
|
497
|
-
object$1.isPlainObject = isPlainObject$1;
|
|
498
|
-
function isntPlainObject$1(val) {
|
|
499
|
-
return !isPlainObject$1(val);
|
|
500
|
-
}
|
|
501
|
-
object$1.isntPlainObject = isntPlainObject$1;
|
|
502
|
-
function isEmptyObject$1(val) {
|
|
503
|
-
return Object.keys(val).length === 0;
|
|
504
|
-
}
|
|
505
|
-
object$1.isEmptyObject = isEmptyObject$1;
|
|
506
|
-
function isntEmptyObject$1(val) {
|
|
507
|
-
return Object.keys(val).length !== 0;
|
|
508
|
-
}
|
|
509
|
-
object$1.isntEmptyObject = isntEmptyObject$1;
|
|
510
|
-
|
|
511
|
-
json$1.isntJsonable = json$1.isJsonable = json$1.isntJson = json$1.isJson = void 0;
|
|
512
|
-
const null_1$3 = _null$1;
|
|
513
|
-
const boolean_1$1 = boolean$1;
|
|
514
|
-
const string_1$2 = string$1;
|
|
515
|
-
const number_1$1 = number$1;
|
|
516
|
-
const array_1$1 = array$1;
|
|
517
|
-
const object_1$3 = object$1;
|
|
518
|
-
function isJson$1(val) {
|
|
519
|
-
return (0, null_1$3.isNull)(val)
|
|
520
|
-
|| (0, boolean_1$1.isBoolean)(val)
|
|
521
|
-
|| (0, string_1$2.isString)(val)
|
|
522
|
-
|| (0, number_1$1.isNumber)(val)
|
|
523
|
-
|| ((0, array_1$1.isArray)(val) && val.every(isJson$1))
|
|
524
|
-
|| ((0, object_1$3.isPlainObject)(val) && Object.values(val).every(isJson$1));
|
|
525
|
-
}
|
|
526
|
-
json$1.isJson = isJson$1;
|
|
527
|
-
function isntJson$1(val) {
|
|
528
|
-
return !isJson$1(val);
|
|
529
|
-
}
|
|
530
|
-
json$1.isntJson = isntJson$1;
|
|
531
|
-
function isJsonable$1(val) {
|
|
532
|
-
try {
|
|
533
|
-
JSON.stringify(val);
|
|
534
|
-
return true;
|
|
535
|
-
}
|
|
536
|
-
catch (_a) {
|
|
537
|
-
return false;
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
json$1.isJsonable = isJsonable$1;
|
|
541
|
-
function isntJsonable$1(val) {
|
|
542
|
-
return !isntJsonable$1();
|
|
543
|
-
}
|
|
544
|
-
json$1.isntJsonable = isntJsonable$1;
|
|
545
|
-
|
|
546
|
-
var promise$1 = {};
|
|
547
|
-
|
|
548
|
-
promise$1.isPromiseLike = promise$1.isntPromiseLike = promise$1.isntPromise = promise$1.isPromise = void 0;
|
|
549
|
-
const object_1$2 = object$1;
|
|
550
|
-
const function_1$3 = _function$1;
|
|
551
|
-
function isPromise$1(val) {
|
|
552
|
-
return val instanceof Promise;
|
|
553
|
-
}
|
|
554
|
-
promise$1.isPromise = isPromise$1;
|
|
555
|
-
function isntPromise$1(val) {
|
|
556
|
-
return !isPromise$1(val);
|
|
557
|
-
}
|
|
558
|
-
promise$1.isntPromise = isntPromise$1;
|
|
559
|
-
function isntPromiseLike$1(val) {
|
|
560
|
-
return !isPromiseLike$1(val);
|
|
561
|
-
}
|
|
562
|
-
promise$1.isntPromiseLike = isntPromiseLike$1;
|
|
563
|
-
function isPromiseLike$1(val) {
|
|
564
|
-
return (0, object_1$2.isObject)(val)
|
|
565
|
-
&& (0, function_1$3.isFunction)(val.then);
|
|
566
|
-
}
|
|
567
|
-
promise$1.isPromiseLike = isPromiseLike$1;
|
|
568
|
-
|
|
569
|
-
var url$1 = {};
|
|
570
|
-
|
|
571
|
-
url$1.isAbsoluteURL = void 0;
|
|
572
|
-
function isAbsoluteURL$1(str) {
|
|
573
|
-
try {
|
|
574
|
-
new URL(str);
|
|
575
|
-
return true;
|
|
576
|
-
}
|
|
577
|
-
catch (_a) {
|
|
578
|
-
return false;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
url$1.isAbsoluteURL = isAbsoluteURL$1;
|
|
582
|
-
|
|
583
|
-
var regexp$1 = {};
|
|
584
|
-
|
|
585
|
-
regexp$1.isntRegExp = regexp$1.isRegExp = void 0;
|
|
586
|
-
function isRegExp$1(val) {
|
|
587
|
-
return val instanceof RegExp;
|
|
588
|
-
}
|
|
589
|
-
regexp$1.isRegExp = isRegExp$1;
|
|
590
|
-
function isntRegExp$1(val) {
|
|
591
|
-
return !isRegExp$1(val);
|
|
592
|
-
}
|
|
593
|
-
regexp$1.isntRegExp = isntRegExp$1;
|
|
594
|
-
|
|
595
|
-
var symbol = {};
|
|
596
|
-
|
|
597
|
-
symbol.isntSymbol = symbol.isSymbol = void 0;
|
|
598
|
-
function isSymbol(val) {
|
|
599
|
-
return typeof val === 'symbol';
|
|
600
|
-
}
|
|
601
|
-
symbol.isSymbol = isSymbol;
|
|
602
|
-
function isntSymbol(val) {
|
|
603
|
-
return !isSymbol(val);
|
|
604
|
-
}
|
|
605
|
-
symbol.isntSymbol = isntSymbol;
|
|
606
|
-
|
|
607
|
-
(function (exports) {
|
|
608
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
609
|
-
if (k2 === undefined) k2 = k;
|
|
610
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
611
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
612
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
613
|
-
}
|
|
614
|
-
Object.defineProperty(o, k2, desc);
|
|
615
|
-
}) : (function(o, m, k, k2) {
|
|
616
|
-
if (k2 === undefined) k2 = k;
|
|
617
|
-
o[k2] = m[k];
|
|
618
|
-
}));
|
|
619
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
620
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
621
|
-
};__exportStar(array$1, exports);
|
|
622
|
-
__exportStar(asyncIterable$1, exports);
|
|
623
|
-
__exportStar(bigint$1, exports);
|
|
624
|
-
__exportStar(boolean$1, exports);
|
|
625
|
-
__exportStar(char$1, exports);
|
|
626
|
-
__exportStar(date$1, exports);
|
|
627
|
-
__exportStar(_enum$1, exports);
|
|
628
|
-
__exportStar(error$1, exports);
|
|
629
|
-
__exportStar(falsy$1, exports);
|
|
630
|
-
__exportStar(_function$1, exports);
|
|
631
|
-
__exportStar(iterable$1, exports);
|
|
632
|
-
__exportStar(json$1, exports);
|
|
633
|
-
__exportStar(_null$1, exports);
|
|
634
|
-
__exportStar(number$1, exports);
|
|
635
|
-
__exportStar(object$1, exports);
|
|
636
|
-
__exportStar(promise$1, exports);
|
|
637
|
-
__exportStar(string$1, exports);
|
|
638
|
-
__exportStar(_undefined$1, exports);
|
|
639
|
-
__exportStar(url$1, exports);
|
|
640
|
-
__exportStar(regexp$1, exports);
|
|
641
|
-
__exportStar(symbol, exports);
|
|
642
|
-
|
|
643
|
-
} (es2018$7));
|
|
644
|
-
|
|
645
|
-
function convertConsToArray([value, next]) {
|
|
646
|
-
if (es2018$7.isNull(next)) {
|
|
647
|
-
return [value];
|
|
648
|
-
}
|
|
649
|
-
else {
|
|
650
|
-
return [value, ...convertConsToArray(next)];
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
function convertArrayToCons([value, ...next]) {
|
|
654
|
-
return [value, next.length ? convertArrayToCons(next) : null];
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
function sliceArrayLeft(arr, num) {
|
|
658
|
-
return arr.slice(0, num);
|
|
659
|
-
}
|
|
660
|
-
function sliceArrayRight(arr, num) {
|
|
661
|
-
const startIndex = arr.length - num;
|
|
662
|
-
return arr.slice(startIndex >= 0 ? startIndex : 0);
|
|
663
|
-
}
|
|
664
|
-
function truncateArrayLeft(arr, num) {
|
|
665
|
-
if (arr.length > num) {
|
|
666
|
-
arr.length = num;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
function truncateArrayRight(arr, num) {
|
|
670
|
-
const startIndex = arr.length - num;
|
|
671
|
-
arr.splice(0, startIndex);
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
var es2018$6 = {};
|
|
675
|
-
|
|
676
|
-
var go$1 = {};
|
|
677
|
-
|
|
678
|
-
go$1.go = void 0;
|
|
679
|
-
function go(fn) {
|
|
680
|
-
return fn();
|
|
681
|
-
}
|
|
682
|
-
go$1.go = go;
|
|
683
|
-
|
|
684
|
-
var goMicrotask$1 = {};
|
|
685
|
-
|
|
686
|
-
goMicrotask$1.goMicrotask = void 0;
|
|
687
|
-
function goMicrotask(fn) {
|
|
688
|
-
return new Promise((resolve, reject) => {
|
|
689
|
-
queueMicrotask(async () => {
|
|
690
|
-
try {
|
|
691
|
-
resolve(await fn());
|
|
692
|
-
}
|
|
693
|
-
catch (e) {
|
|
694
|
-
reject(e);
|
|
695
|
-
}
|
|
696
|
-
});
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
goMicrotask$1.goMicrotask = goMicrotask;
|
|
700
|
-
|
|
701
|
-
var goMacrotask$1 = {};
|
|
702
|
-
|
|
703
|
-
var es2018$5 = {};
|
|
704
|
-
|
|
705
|
-
var exponentialBackoff = {};
|
|
706
|
-
|
|
707
|
-
var es2018$4 = {};
|
|
708
|
-
|
|
709
|
-
var random$1 = {};
|
|
710
|
-
|
|
711
|
-
random$1.random = void 0;
|
|
712
|
-
function random(min, max) {
|
|
713
|
-
return Math.random() * (max - min) + min;
|
|
714
|
-
}
|
|
715
|
-
random$1.random = random;
|
|
716
|
-
|
|
717
|
-
var randomInt$1 = {};
|
|
718
|
-
|
|
719
|
-
randomInt$1.randomInt = void 0;
|
|
720
|
-
function randomInt(min, max) {
|
|
721
|
-
min = Math.ceil(min);
|
|
722
|
-
max = Math.floor(max);
|
|
723
|
-
return Math.floor(Math.random() * (max - min)) + min;
|
|
724
|
-
}
|
|
725
|
-
randomInt$1.randomInt = randomInt;
|
|
726
|
-
|
|
727
|
-
var randomIntInclusive$1 = {};
|
|
728
|
-
|
|
729
|
-
randomIntInclusive$1.randomIntInclusive = void 0;
|
|
730
|
-
function randomIntInclusive(min, max) {
|
|
731
|
-
min = Math.ceil(min);
|
|
732
|
-
max = Math.floor(max);
|
|
733
|
-
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
734
|
-
}
|
|
735
|
-
randomIntInclusive$1.randomIntInclusive = randomIntInclusive;
|
|
736
|
-
|
|
737
|
-
(function (exports) {
|
|
738
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
739
|
-
if (k2 === undefined) k2 = k;
|
|
740
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
741
|
-
}) : (function(o, m, k, k2) {
|
|
742
|
-
if (k2 === undefined) k2 = k;
|
|
743
|
-
o[k2] = m[k];
|
|
744
|
-
}));
|
|
745
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
746
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
747
|
-
};__exportStar(random$1, exports);
|
|
748
|
-
__exportStar(randomInt$1, exports);
|
|
749
|
-
__exportStar(randomIntInclusive$1, exports);
|
|
750
|
-
|
|
751
|
-
} (es2018$4));
|
|
752
|
-
|
|
753
|
-
exponentialBackoff.calculateExponentialBackoffTimeout = void 0;
|
|
754
|
-
const extra_rand_1 = es2018$4;
|
|
755
|
-
function calculateExponentialBackoffTimeout({ baseTimeout, retries, maxTimeout = Infinity, factor = 2, jitter = true }) {
|
|
756
|
-
const timeout = Math.min(factor ** retries * baseTimeout, maxTimeout);
|
|
757
|
-
if (jitter) {
|
|
758
|
-
return (0, extra_rand_1.randomIntInclusive)(0, timeout);
|
|
759
|
-
}
|
|
760
|
-
else {
|
|
761
|
-
return timeout;
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
exponentialBackoff.calculateExponentialBackoffTimeout = calculateExponentialBackoffTimeout;
|
|
765
|
-
|
|
766
|
-
var setTimeout$1 = {};
|
|
767
|
-
|
|
768
|
-
setTimeout$1.setTimeout = void 0;
|
|
769
|
-
function setTimeout(timeout, cb) {
|
|
770
|
-
const timer = globalThis.setTimeout(cb, timeout);
|
|
771
|
-
return () => clearTimeout(timer);
|
|
772
|
-
}
|
|
773
|
-
setTimeout$1.setTimeout = setTimeout;
|
|
774
|
-
|
|
775
|
-
var setSchedule$1 = {};
|
|
776
|
-
|
|
777
|
-
setSchedule$1.setSchedule = void 0;
|
|
778
|
-
const set_timeout_1$3 = setTimeout$1;
|
|
779
|
-
function setSchedule(timestamp, cb) {
|
|
780
|
-
const timeout = timestamp - Date.now();
|
|
781
|
-
return (0, set_timeout_1$3.setTimeout)(timeout, cb);
|
|
782
|
-
}
|
|
783
|
-
setSchedule$1.setSchedule = setSchedule;
|
|
784
|
-
|
|
785
|
-
var setInterval$1 = {};
|
|
786
|
-
|
|
787
|
-
setInterval$1.setInterval = void 0;
|
|
788
|
-
function setInterval(timeout, cb) {
|
|
789
|
-
const timer = globalThis.setInterval(cb, timeout);
|
|
790
|
-
return () => clearInterval(timer);
|
|
791
|
-
}
|
|
792
|
-
setInterval$1.setInterval = setInterval;
|
|
793
|
-
|
|
794
|
-
var setImmediate$1 = {};
|
|
795
|
-
|
|
796
|
-
setImmediate$1.setImmediate = void 0;
|
|
797
|
-
const set_timeout_1$2 = setTimeout$1;
|
|
798
|
-
function setImmediate(cb) {
|
|
799
|
-
if (globalThis.setImmediate) {
|
|
800
|
-
const timer = globalThis.setImmediate(cb);
|
|
801
|
-
return () => clearImmediate(timer);
|
|
802
|
-
}
|
|
803
|
-
else {
|
|
804
|
-
return (0, set_timeout_1$2.setTimeout)(0, cb);
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
setImmediate$1.setImmediate = setImmediate;
|
|
808
|
-
|
|
809
|
-
var setTimeoutLoop$1 = {};
|
|
810
|
-
|
|
811
|
-
setTimeoutLoop$1.setTimeoutLoop = void 0;
|
|
812
|
-
const set_timeout_1$1 = setTimeout$1;
|
|
813
|
-
function setTimeoutLoop(timeout, cb) {
|
|
814
|
-
let isCancelled = false;
|
|
815
|
-
let cancel = (0, set_timeout_1$1.setTimeout)(timeout, loop);
|
|
816
|
-
return () => {
|
|
817
|
-
isCancelled = true;
|
|
818
|
-
cancel();
|
|
819
|
-
};
|
|
820
|
-
async function loop() {
|
|
821
|
-
await cb();
|
|
822
|
-
if (!isCancelled) {
|
|
823
|
-
cancel = (0, set_timeout_1$1.setTimeout)(timeout, loop);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
setTimeoutLoop$1.setTimeoutLoop = setTimeoutLoop;
|
|
828
|
-
|
|
829
|
-
var setDynamicTimeoutLoop$1 = {};
|
|
830
|
-
|
|
831
|
-
setDynamicTimeoutLoop$1.setDynamicTimeoutLoop = void 0;
|
|
832
|
-
const set_timeout_1 = setTimeout$1;
|
|
833
|
-
function setDynamicTimeoutLoop(timeout, cb) {
|
|
834
|
-
let isCancelled = false;
|
|
835
|
-
let cancel = (0, set_timeout_1.setTimeout)(timeout, loop);
|
|
836
|
-
return () => {
|
|
837
|
-
isCancelled = true;
|
|
838
|
-
cancel();
|
|
839
|
-
};
|
|
840
|
-
async function loop() {
|
|
841
|
-
const start = Date.now();
|
|
842
|
-
await cb();
|
|
843
|
-
const elapsed = Date.now() - start;
|
|
844
|
-
if (!isCancelled) {
|
|
845
|
-
cancel = (0, set_timeout_1.setTimeout)(Math.max(timeout - elapsed, 0), loop);
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
setDynamicTimeoutLoop$1.setDynamicTimeoutLoop = setDynamicTimeoutLoop;
|
|
850
|
-
|
|
851
|
-
(function (exports) {
|
|
852
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
853
|
-
if (k2 === undefined) k2 = k;
|
|
854
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
855
|
-
}) : (function(o, m, k, k2) {
|
|
856
|
-
if (k2 === undefined) k2 = k;
|
|
857
|
-
o[k2] = m[k];
|
|
858
|
-
}));
|
|
859
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
860
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
861
|
-
};__exportStar(exponentialBackoff, exports);
|
|
862
|
-
__exportStar(setTimeout$1, exports);
|
|
863
|
-
__exportStar(setSchedule$1, exports);
|
|
864
|
-
__exportStar(setInterval$1, exports);
|
|
865
|
-
__exportStar(setImmediate$1, exports);
|
|
866
|
-
__exportStar(setTimeoutLoop$1, exports);
|
|
867
|
-
__exportStar(setDynamicTimeoutLoop$1, exports);
|
|
868
|
-
|
|
869
|
-
} (es2018$5));
|
|
870
|
-
|
|
871
|
-
goMacrotask$1.goMacrotask = void 0;
|
|
872
|
-
const extra_timers_1 = es2018$5;
|
|
873
|
-
function goMacrotask(fn) {
|
|
874
|
-
return new Promise((resolve, reject) => {
|
|
875
|
-
(0, extra_timers_1.setImmediate)(async () => {
|
|
876
|
-
try {
|
|
877
|
-
resolve(await fn());
|
|
878
|
-
}
|
|
879
|
-
catch (e) {
|
|
880
|
-
reject(e);
|
|
881
|
-
}
|
|
882
|
-
});
|
|
883
|
-
});
|
|
884
|
-
}
|
|
885
|
-
goMacrotask$1.goMacrotask = goMacrotask;
|
|
886
|
-
|
|
887
|
-
(function (exports) {
|
|
888
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
889
|
-
if (k2 === undefined) k2 = k;
|
|
890
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
891
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
892
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
893
|
-
}
|
|
894
|
-
Object.defineProperty(o, k2, desc);
|
|
895
|
-
}) : (function(o, m, k, k2) {
|
|
896
|
-
if (k2 === undefined) k2 = k;
|
|
897
|
-
o[k2] = m[k];
|
|
898
|
-
}));
|
|
899
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
900
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
901
|
-
};__exportStar(go$1, exports);
|
|
902
|
-
__exportStar(goMicrotask$1, exports);
|
|
903
|
-
__exportStar(goMacrotask$1, exports);
|
|
904
|
-
|
|
905
|
-
} (es2018$6));
|
|
906
|
-
|
|
907
|
-
class Emitter {
|
|
908
|
-
constructor() {
|
|
909
|
-
this.map = new Map();
|
|
910
|
-
}
|
|
911
|
-
get [Symbol.toStringTag]() {
|
|
912
|
-
return this.constructor.name;
|
|
913
|
-
}
|
|
914
|
-
on(event, listener) {
|
|
915
|
-
const set = es2018$6.go(() => {
|
|
916
|
-
const set = this.map.get(event);
|
|
917
|
-
if (set) {
|
|
918
|
-
return set;
|
|
919
|
-
}
|
|
920
|
-
else {
|
|
921
|
-
const set = new Set();
|
|
922
|
-
this.map.set(event, set);
|
|
923
|
-
return set;
|
|
924
|
-
}
|
|
925
|
-
});
|
|
926
|
-
set.add(handler);
|
|
927
|
-
return () => {
|
|
928
|
-
const handlers = this.map.get(event);
|
|
929
|
-
if (handlers) {
|
|
930
|
-
const deleted = handlers.delete(handler);
|
|
931
|
-
if (deleted && handlers.size === 0) {
|
|
932
|
-
this.map.delete(event);
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
};
|
|
936
|
-
function handler(...args) {
|
|
937
|
-
listener(...args);
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
once(event, listener) {
|
|
941
|
-
const removeListener = this.on(event, (...args) => {
|
|
942
|
-
listener(...args);
|
|
943
|
-
removeListener();
|
|
944
|
-
});
|
|
945
|
-
return removeListener;
|
|
946
|
-
}
|
|
947
|
-
emit(event, ...args) {
|
|
948
|
-
var _a;
|
|
949
|
-
(_a = this.map.get(event)) === null || _a === void 0 ? void 0 : _a.forEach(cb => cb(...args));
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
class HashMap {
|
|
954
|
-
constructor(hash) {
|
|
955
|
-
this.hash = hash;
|
|
956
|
-
this.map = new Map();
|
|
957
|
-
}
|
|
958
|
-
get [Symbol.toStringTag]() {
|
|
959
|
-
return this.constructor.name;
|
|
960
|
-
}
|
|
961
|
-
get size() {
|
|
962
|
-
return this.map.size;
|
|
963
|
-
}
|
|
964
|
-
set(key, value) {
|
|
965
|
-
this.map.set(this.hash(key), value);
|
|
966
|
-
return this;
|
|
967
|
-
}
|
|
968
|
-
has(key) {
|
|
969
|
-
return this.map.has(this.hash(key));
|
|
970
|
-
}
|
|
971
|
-
get(key) {
|
|
972
|
-
return this.map.get(this.hash(key));
|
|
973
|
-
}
|
|
974
|
-
delete(key) {
|
|
975
|
-
return this.map.delete(this.hash(key));
|
|
976
|
-
}
|
|
977
|
-
clear() {
|
|
978
|
-
this.map.clear();
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
class HashSet {
|
|
983
|
-
constructor(hash) {
|
|
984
|
-
this.hash = hash;
|
|
985
|
-
this.map = new Map();
|
|
986
|
-
}
|
|
987
|
-
get [Symbol.toStringTag]() {
|
|
988
|
-
return this.constructor.name;
|
|
989
|
-
}
|
|
990
|
-
get size() {
|
|
991
|
-
return this.map.size;
|
|
992
|
-
}
|
|
993
|
-
[Symbol.iterator]() {
|
|
994
|
-
return this.map.values();
|
|
995
|
-
}
|
|
996
|
-
add(value) {
|
|
997
|
-
this.map.set(this.hash(value), value);
|
|
998
|
-
return this;
|
|
999
|
-
}
|
|
1000
|
-
delete(value) {
|
|
1001
|
-
return this.map.delete(this.hash(value));
|
|
1002
|
-
}
|
|
1003
|
-
has(value) {
|
|
1004
|
-
return this.map.has(this.hash(value));
|
|
1005
|
-
}
|
|
1006
|
-
clear() {
|
|
1007
|
-
this.map.clear();
|
|
1008
|
-
}
|
|
1009
|
-
values() {
|
|
1010
|
-
return this.map.values();
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
class Queue {
|
|
1015
|
-
constructor() {
|
|
1016
|
-
this.items = [];
|
|
1017
|
-
}
|
|
1018
|
-
get [Symbol.toStringTag]() {
|
|
1019
|
-
return this.constructor.name;
|
|
1020
|
-
}
|
|
1021
|
-
get size() {
|
|
1022
|
-
return this.items.length;
|
|
1023
|
-
}
|
|
1024
|
-
empty() {
|
|
1025
|
-
this.items.length = 0;
|
|
1026
|
-
}
|
|
1027
|
-
enqueue(...items) {
|
|
1028
|
-
this.items.push(...items);
|
|
1029
|
-
}
|
|
1030
|
-
dequeue() {
|
|
1031
|
-
return this.items.shift();
|
|
1032
|
-
}
|
|
1033
|
-
remove(item) {
|
|
1034
|
-
let index;
|
|
1035
|
-
while ((index = this.items.indexOf(item)) >= 0) {
|
|
1036
|
-
this.items.splice(index, 1);
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
var es2018$3 = {};
|
|
1042
|
-
|
|
1043
|
-
var customError = {};
|
|
1044
|
-
|
|
1045
|
-
var es2018$2 = {};
|
|
1046
|
-
|
|
1047
|
-
var middleware = {};
|
|
1048
|
-
|
|
1049
|
-
var chunkAsync = {};
|
|
1050
|
-
|
|
1051
|
-
var hasRequiredChunkAsync;
|
|
1052
|
-
|
|
1053
|
-
function requireChunkAsync () {
|
|
1054
|
-
if (hasRequiredChunkAsync) return chunkAsync;
|
|
1055
|
-
hasRequiredChunkAsync = 1;
|
|
1056
|
-
chunkAsync.chunkAsync = void 0;
|
|
1057
|
-
const go_1 = es2018$6;
|
|
1058
|
-
const errors_1 = requireEs2018();
|
|
1059
|
-
function chunkAsync$1(iterable, size) {
|
|
1060
|
-
(0, errors_1.assert)(Number.isInteger(size), 'The parameter size must be an integer');
|
|
1061
|
-
(0, errors_1.assert)(size > 0, 'The parameter size must be greater than 0');
|
|
1062
|
-
return (0, go_1.go)(async function* () {
|
|
1063
|
-
let buffer = [];
|
|
1064
|
-
for await (const element of iterable) {
|
|
1065
|
-
buffer.push(element);
|
|
1066
|
-
if (buffer.length >= size) {
|
|
1067
|
-
yield buffer;
|
|
1068
|
-
buffer = [];
|
|
1069
|
-
}
|
|
1070
|
-
}
|
|
1071
|
-
if (buffer.length)
|
|
1072
|
-
yield buffer;
|
|
1073
|
-
});
|
|
1074
|
-
}
|
|
1075
|
-
chunkAsync.chunkAsync = chunkAsync$1;
|
|
1076
|
-
|
|
1077
|
-
return chunkAsync;
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
var chunkByAsync$1 = {};
|
|
1081
|
-
|
|
1082
|
-
var es2018$1 = {};
|
|
1083
|
-
|
|
1084
|
-
var array = {};
|
|
1085
|
-
|
|
1086
|
-
array.isntEmptyArray = array.isEmptyArray = array.isntArray = array.isArray = void 0;
|
|
1087
|
-
function isArray(val) {
|
|
1088
|
-
return Array.isArray(val);
|
|
1089
|
-
}
|
|
1090
|
-
array.isArray = isArray;
|
|
1091
|
-
function isntArray(val) {
|
|
1092
|
-
return !isArray(val);
|
|
1093
|
-
}
|
|
1094
|
-
array.isntArray = isntArray;
|
|
1095
|
-
function isEmptyArray(val) {
|
|
1096
|
-
return val.length === 0;
|
|
1097
|
-
}
|
|
1098
|
-
array.isEmptyArray = isEmptyArray;
|
|
1099
|
-
function isntEmptyArray(val) {
|
|
1100
|
-
return val.length !== 0;
|
|
1101
|
-
}
|
|
1102
|
-
array.isntEmptyArray = isntEmptyArray;
|
|
1103
|
-
|
|
1104
|
-
var asyncIterable = {};
|
|
1105
|
-
|
|
1106
|
-
var _null = {};
|
|
1107
|
-
|
|
1108
|
-
_null.isntNull = _null.isNull = void 0;
|
|
1109
|
-
function isNull(val) {
|
|
1110
|
-
return val === null;
|
|
1111
|
-
}
|
|
1112
|
-
_null.isNull = isNull;
|
|
1113
|
-
function isntNull(val) {
|
|
1114
|
-
return !isNull(val);
|
|
1115
|
-
}
|
|
1116
|
-
_null.isntNull = isntNull;
|
|
1117
|
-
|
|
1118
|
-
var _undefined = {};
|
|
1119
|
-
|
|
1120
|
-
_undefined.isntUndefined = _undefined.isUndefined = void 0;
|
|
1121
|
-
function isUndefined(val) {
|
|
1122
|
-
return val === undefined;
|
|
1123
|
-
}
|
|
1124
|
-
_undefined.isUndefined = isUndefined;
|
|
1125
|
-
function isntUndefined(val) {
|
|
1126
|
-
return !isUndefined(val);
|
|
1127
|
-
}
|
|
1128
|
-
_undefined.isntUndefined = isntUndefined;
|
|
1129
|
-
|
|
1130
|
-
var _function = {};
|
|
1131
|
-
|
|
1132
|
-
_function.isntFunction = _function.isFunction = void 0;
|
|
1133
|
-
function isFunction(val) {
|
|
1134
|
-
return typeof val === 'function';
|
|
1135
|
-
}
|
|
1136
|
-
_function.isFunction = isFunction;
|
|
1137
|
-
function isntFunction(val) {
|
|
1138
|
-
return !isFunction(val);
|
|
1139
|
-
}
|
|
1140
|
-
_function.isntFunction = isntFunction;
|
|
1141
|
-
|
|
1142
|
-
asyncIterable.isntAsyncIterable = asyncIterable.isAsyncIterable = void 0;
|
|
1143
|
-
const null_1$2 = _null;
|
|
1144
|
-
const undefined_1$1 = _undefined;
|
|
1145
|
-
const function_1$2 = _function;
|
|
1146
|
-
function isAsyncIterable(val) {
|
|
1147
|
-
return (0, null_1$2.isntNull)(val)
|
|
1148
|
-
&& (0, undefined_1$1.isntUndefined)(val)
|
|
1149
|
-
&& (0, function_1$2.isFunction)(val[Symbol.asyncIterator]);
|
|
1150
|
-
}
|
|
1151
|
-
asyncIterable.isAsyncIterable = isAsyncIterable;
|
|
1152
|
-
function isntAsyncIterable(val) {
|
|
1153
|
-
return !isAsyncIterable(val);
|
|
1154
|
-
}
|
|
1155
|
-
asyncIterable.isntAsyncIterable = isntAsyncIterable;
|
|
1156
|
-
|
|
1157
|
-
var bigint = {};
|
|
1158
|
-
|
|
1159
|
-
bigint.isntBigInt = bigint.isBigInt = void 0;
|
|
1160
|
-
function isBigInt(val) {
|
|
1161
|
-
return typeof val === 'bigint';
|
|
1162
|
-
}
|
|
1163
|
-
bigint.isBigInt = isBigInt;
|
|
1164
|
-
function isntBigInt(val) {
|
|
1165
|
-
return !isBigInt(val);
|
|
1166
|
-
}
|
|
1167
|
-
bigint.isntBigInt = isntBigInt;
|
|
1168
|
-
|
|
1169
|
-
var boolean = {};
|
|
1170
|
-
|
|
1171
|
-
boolean.isntBoolean = boolean.isBoolean = void 0;
|
|
1172
|
-
function isBoolean(val) {
|
|
1173
|
-
return typeof val === 'boolean';
|
|
1174
|
-
}
|
|
1175
|
-
boolean.isBoolean = isBoolean;
|
|
1176
|
-
function isntBoolean(val) {
|
|
1177
|
-
return !isBoolean(val);
|
|
1178
|
-
}
|
|
1179
|
-
boolean.isntBoolean = isntBoolean;
|
|
1180
|
-
|
|
1181
|
-
var char = {};
|
|
1182
|
-
|
|
1183
|
-
var string = {};
|
|
1184
|
-
|
|
1185
|
-
string.isntString = string.isString = void 0;
|
|
1186
|
-
function isString(val) {
|
|
1187
|
-
return typeof val === 'string';
|
|
1188
|
-
}
|
|
1189
|
-
string.isString = isString;
|
|
1190
|
-
function isntString(val) {
|
|
1191
|
-
return !isString(val);
|
|
1192
|
-
}
|
|
1193
|
-
string.isntString = isntString;
|
|
1194
|
-
|
|
1195
|
-
char.isntChar = char.isChar = void 0;
|
|
1196
|
-
const string_1$1 = string;
|
|
1197
|
-
function isChar(val) {
|
|
1198
|
-
return (0, string_1$1.isString)(val)
|
|
1199
|
-
&& val.length === 1;
|
|
1200
|
-
}
|
|
1201
|
-
char.isChar = isChar;
|
|
1202
|
-
function isntChar(val) {
|
|
1203
|
-
return !isChar(val);
|
|
1204
|
-
}
|
|
1205
|
-
char.isntChar = isntChar;
|
|
1206
|
-
|
|
1207
|
-
var date = {};
|
|
1208
|
-
|
|
1209
|
-
date.isntDate = date.isDate = void 0;
|
|
1210
|
-
function isDate(val) {
|
|
1211
|
-
return val instanceof Date;
|
|
1212
|
-
}
|
|
1213
|
-
date.isDate = isDate;
|
|
1214
|
-
function isntDate(val) {
|
|
1215
|
-
return !isDate(val);
|
|
1216
|
-
}
|
|
1217
|
-
date.isntDate = isntDate;
|
|
1218
|
-
|
|
1219
|
-
var _enum = {};
|
|
1220
|
-
|
|
1221
|
-
_enum.inEnum = void 0;
|
|
1222
|
-
function inEnum(val, _enum) {
|
|
1223
|
-
return Object.values(_enum).includes(val);
|
|
1224
|
-
}
|
|
1225
|
-
_enum.inEnum = inEnum;
|
|
1226
|
-
|
|
1227
|
-
var error = {};
|
|
1228
|
-
|
|
1229
|
-
error.isntError = error.isError = void 0;
|
|
1230
|
-
function isError(val) {
|
|
1231
|
-
return val instanceof Error;
|
|
1232
|
-
}
|
|
1233
|
-
error.isError = isError;
|
|
1234
|
-
function isntError(val) {
|
|
1235
|
-
return !isError(val);
|
|
1236
|
-
}
|
|
1237
|
-
error.isntError = isntError;
|
|
1238
|
-
|
|
1239
|
-
var falsy = {};
|
|
1240
|
-
|
|
1241
|
-
falsy.isntFalsy = falsy.isFalsy = void 0;
|
|
1242
|
-
function isFalsy(val) {
|
|
1243
|
-
return !val;
|
|
1244
|
-
}
|
|
1245
|
-
falsy.isFalsy = isFalsy;
|
|
1246
|
-
function isntFalsy(val) {
|
|
1247
|
-
return !isFalsy(val);
|
|
1248
|
-
}
|
|
1249
|
-
falsy.isntFalsy = isntFalsy;
|
|
1250
|
-
|
|
1251
|
-
var iterable = {};
|
|
1252
|
-
|
|
1253
|
-
iterable.isntIterable = iterable.isIterable = void 0;
|
|
1254
|
-
const null_1$1 = _null;
|
|
1255
|
-
const undefined_1 = _undefined;
|
|
1256
|
-
const function_1$1 = _function;
|
|
1257
|
-
function isIterable(val) {
|
|
1258
|
-
return (0, null_1$1.isntNull)(val)
|
|
1259
|
-
&& (0, undefined_1.isntUndefined)(val)
|
|
1260
|
-
&& (0, function_1$1.isFunction)(val[Symbol.iterator]);
|
|
1261
|
-
}
|
|
1262
|
-
iterable.isIterable = isIterable;
|
|
1263
|
-
function isntIterable(val) {
|
|
1264
|
-
return !isIterable(val);
|
|
1265
|
-
}
|
|
1266
|
-
iterable.isntIterable = isntIterable;
|
|
1267
|
-
|
|
1268
|
-
var json = {};
|
|
1269
|
-
|
|
1270
|
-
var number = {};
|
|
1271
|
-
|
|
1272
|
-
number.isntNaN = number.isNaN = number.isNegativeInfinity = number.isPositiveInfinity = number.isFinite = number.isntNumber = number.isNumber = void 0;
|
|
1273
|
-
function isNumber(val) {
|
|
1274
|
-
return typeof val === 'number';
|
|
1275
|
-
}
|
|
1276
|
-
number.isNumber = isNumber;
|
|
1277
|
-
function isntNumber(val) {
|
|
1278
|
-
return !isNumber(val);
|
|
1279
|
-
}
|
|
1280
|
-
number.isntNumber = isntNumber;
|
|
1281
|
-
function isFinite(val) {
|
|
1282
|
-
return Number.isFinite(val);
|
|
1283
|
-
}
|
|
1284
|
-
number.isFinite = isFinite;
|
|
1285
|
-
function isPositiveInfinity(val) {
|
|
1286
|
-
return val === Infinity;
|
|
1287
|
-
}
|
|
1288
|
-
number.isPositiveInfinity = isPositiveInfinity;
|
|
1289
|
-
function isNegativeInfinity(val) {
|
|
1290
|
-
return val === -Infinity;
|
|
1291
|
-
}
|
|
1292
|
-
number.isNegativeInfinity = isNegativeInfinity;
|
|
1293
|
-
function isNaN(val) {
|
|
1294
|
-
return Number.isNaN(val);
|
|
1295
|
-
}
|
|
1296
|
-
number.isNaN = isNaN;
|
|
1297
|
-
function isntNaN(val) {
|
|
1298
|
-
return !isNaN(val);
|
|
1299
|
-
}
|
|
1300
|
-
number.isntNaN = isntNaN;
|
|
1301
|
-
|
|
1302
|
-
var object = {};
|
|
1303
|
-
|
|
1304
|
-
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
1305
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
1306
|
-
};object.isntEmptyObject = object.isEmptyObject = object.isntPlainObject = object.isPlainObject = object.isntObject = object.isObject = void 0;
|
|
1307
|
-
const isPlainObject_1 = __importDefault(isPlainObject_1$2);
|
|
1308
|
-
function isObject(val) {
|
|
1309
|
-
return val !== null
|
|
1310
|
-
&& typeof val === 'object';
|
|
1311
|
-
}
|
|
1312
|
-
object.isObject = isObject;
|
|
1313
|
-
function isntObject(val) {
|
|
1314
|
-
return !isObject(val);
|
|
1315
|
-
}
|
|
1316
|
-
object.isntObject = isntObject;
|
|
1317
|
-
function isPlainObject(val) {
|
|
1318
|
-
return (0, isPlainObject_1.default)(val);
|
|
1319
|
-
}
|
|
1320
|
-
object.isPlainObject = isPlainObject;
|
|
1321
|
-
function isntPlainObject(val) {
|
|
1322
|
-
return !isPlainObject(val);
|
|
1323
|
-
}
|
|
1324
|
-
object.isntPlainObject = isntPlainObject;
|
|
1325
|
-
function isEmptyObject(val) {
|
|
1326
|
-
return Object.keys(val).length === 0;
|
|
1327
|
-
}
|
|
1328
|
-
object.isEmptyObject = isEmptyObject;
|
|
1329
|
-
function isntEmptyObject(val) {
|
|
1330
|
-
return Object.keys(val).length !== 0;
|
|
1331
|
-
}
|
|
1332
|
-
object.isntEmptyObject = isntEmptyObject;
|
|
1333
|
-
|
|
1334
|
-
json.isntJsonable = json.isJsonable = json.isntJson = json.isJson = void 0;
|
|
1335
|
-
const null_1 = _null;
|
|
1336
|
-
const boolean_1 = boolean;
|
|
1337
|
-
const string_1 = string;
|
|
1338
|
-
const number_1 = number;
|
|
1339
|
-
const array_1 = array;
|
|
1340
|
-
const object_1$1 = object;
|
|
1341
|
-
function isJson(val) {
|
|
1342
|
-
return (0, null_1.isNull)(val)
|
|
1343
|
-
|| (0, boolean_1.isBoolean)(val)
|
|
1344
|
-
|| (0, string_1.isString)(val)
|
|
1345
|
-
|| (0, number_1.isNumber)(val)
|
|
1346
|
-
|| ((0, array_1.isArray)(val) && val.every(isJson))
|
|
1347
|
-
|| ((0, object_1$1.isPlainObject)(val) && Object.values(val).every(isJson));
|
|
1348
|
-
}
|
|
1349
|
-
json.isJson = isJson;
|
|
1350
|
-
function isntJson(val) {
|
|
1351
|
-
return !isJson(val);
|
|
1352
|
-
}
|
|
1353
|
-
json.isntJson = isntJson;
|
|
1354
|
-
function isJsonable(val) {
|
|
1355
|
-
try {
|
|
1356
|
-
JSON.stringify(val);
|
|
1357
|
-
return true;
|
|
1358
|
-
}
|
|
1359
|
-
catch (_a) {
|
|
1360
|
-
return false;
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
json.isJsonable = isJsonable;
|
|
1364
|
-
function isntJsonable(val) {
|
|
1365
|
-
return !isntJsonable();
|
|
1366
|
-
}
|
|
1367
|
-
json.isntJsonable = isntJsonable;
|
|
1368
|
-
|
|
1369
|
-
var promise = {};
|
|
1370
|
-
|
|
1371
|
-
promise.isPromiseLike = promise.isntPromiseLike = promise.isntPromise = promise.isPromise = void 0;
|
|
1372
|
-
const object_1 = object;
|
|
1373
|
-
const function_1 = _function;
|
|
1374
|
-
function isPromise(val) {
|
|
1375
|
-
return val instanceof Promise;
|
|
1376
|
-
}
|
|
1377
|
-
promise.isPromise = isPromise;
|
|
1378
|
-
function isntPromise(val) {
|
|
1379
|
-
return !isPromise(val);
|
|
1380
|
-
}
|
|
1381
|
-
promise.isntPromise = isntPromise;
|
|
1382
|
-
function isntPromiseLike(val) {
|
|
1383
|
-
return !isPromiseLike(val);
|
|
1384
|
-
}
|
|
1385
|
-
promise.isntPromiseLike = isntPromiseLike;
|
|
1386
|
-
function isPromiseLike(val) {
|
|
1387
|
-
return (0, object_1.isObject)(val)
|
|
1388
|
-
&& (0, function_1.isFunction)(val.then);
|
|
1389
|
-
}
|
|
1390
|
-
promise.isPromiseLike = isPromiseLike;
|
|
1391
|
-
|
|
1392
|
-
var url = {};
|
|
1393
|
-
|
|
1394
|
-
url.isAbsoluteURL = void 0;
|
|
1395
|
-
function isAbsoluteURL(str) {
|
|
1396
|
-
try {
|
|
1397
|
-
new URL(str);
|
|
1398
|
-
return true;
|
|
1399
|
-
}
|
|
1400
|
-
catch (_a) {
|
|
1401
|
-
return false;
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
url.isAbsoluteURL = isAbsoluteURL;
|
|
1405
|
-
|
|
1406
|
-
var regexp = {};
|
|
1407
|
-
|
|
1408
|
-
regexp.isntRegExp = regexp.isRegExp = void 0;
|
|
1409
|
-
function isRegExp(val) {
|
|
1410
|
-
return val instanceof RegExp;
|
|
1411
|
-
}
|
|
1412
|
-
regexp.isRegExp = isRegExp;
|
|
1413
|
-
function isntRegExp(val) {
|
|
1414
|
-
return !isRegExp(val);
|
|
1415
|
-
}
|
|
1416
|
-
regexp.isntRegExp = isntRegExp;
|
|
1417
|
-
|
|
1418
|
-
(function (exports) {
|
|
1419
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
1420
|
-
if (k2 === undefined) k2 = k;
|
|
1421
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1422
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1423
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
1424
|
-
}
|
|
1425
|
-
Object.defineProperty(o, k2, desc);
|
|
1426
|
-
}) : (function(o, m, k, k2) {
|
|
1427
|
-
if (k2 === undefined) k2 = k;
|
|
1428
|
-
o[k2] = m[k];
|
|
1429
|
-
}));
|
|
1430
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
1431
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1432
|
-
};__exportStar(array, exports);
|
|
1433
|
-
__exportStar(asyncIterable, exports);
|
|
1434
|
-
__exportStar(bigint, exports);
|
|
1435
|
-
__exportStar(boolean, exports);
|
|
1436
|
-
__exportStar(char, exports);
|
|
1437
|
-
__exportStar(date, exports);
|
|
1438
|
-
__exportStar(_enum, exports);
|
|
1439
|
-
__exportStar(error, exports);
|
|
1440
|
-
__exportStar(falsy, exports);
|
|
1441
|
-
__exportStar(_function, exports);
|
|
1442
|
-
__exportStar(iterable, exports);
|
|
1443
|
-
__exportStar(json, exports);
|
|
1444
|
-
__exportStar(_null, exports);
|
|
1445
|
-
__exportStar(number, exports);
|
|
1446
|
-
__exportStar(object, exports);
|
|
1447
|
-
__exportStar(promise, exports);
|
|
1448
|
-
__exportStar(string, exports);
|
|
1449
|
-
__exportStar(_undefined, exports);
|
|
1450
|
-
__exportStar(url, exports);
|
|
1451
|
-
__exportStar(regexp, exports);
|
|
1452
|
-
|
|
1453
|
-
} (es2018$1));
|
|
1454
|
-
|
|
1455
|
-
chunkByAsync$1.chunkByAsync = void 0;
|
|
1456
|
-
const types_1$j = es2018$1;
|
|
1457
|
-
function chunkByAsync(iterable, predicate) {
|
|
1458
|
-
if ((0, types_1$j.isAsyncIterable)(iterable)) {
|
|
1459
|
-
return chunkByAsyncIterable(iterable, predicate);
|
|
1460
|
-
}
|
|
1461
|
-
else {
|
|
1462
|
-
return chunkByIterable(iterable, predicate);
|
|
1463
|
-
}
|
|
1464
|
-
}
|
|
1465
|
-
chunkByAsync$1.chunkByAsync = chunkByAsync;
|
|
1466
|
-
async function* chunkByAsyncIterable(iterable, predicate) {
|
|
1467
|
-
let buffer = [];
|
|
1468
|
-
let index = 0;
|
|
1469
|
-
for await (const element of iterable) {
|
|
1470
|
-
buffer.push(element);
|
|
1471
|
-
if (await predicate(element, index)) {
|
|
1472
|
-
yield buffer;
|
|
1473
|
-
buffer = [];
|
|
1474
|
-
}
|
|
1475
|
-
index++;
|
|
1476
|
-
}
|
|
1477
|
-
if (buffer.length)
|
|
1478
|
-
yield buffer;
|
|
1479
|
-
}
|
|
1480
|
-
async function* chunkByIterable(iterable, predicate) {
|
|
1481
|
-
let buffer = [];
|
|
1482
|
-
let index = 0;
|
|
1483
|
-
for (const element of iterable) {
|
|
1484
|
-
buffer.push(element);
|
|
1485
|
-
if (await predicate(element, index)) {
|
|
1486
|
-
yield buffer;
|
|
1487
|
-
buffer = [];
|
|
1488
|
-
}
|
|
1489
|
-
index++;
|
|
1490
|
-
}
|
|
1491
|
-
if (buffer.length)
|
|
1492
|
-
yield buffer;
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
var chunkBy$1 = {};
|
|
1496
|
-
|
|
1497
|
-
chunkBy$1.chunkBy = void 0;
|
|
1498
|
-
function* chunkBy(iterable, predicate) {
|
|
1499
|
-
let buffer = [];
|
|
1500
|
-
let index = 0;
|
|
1501
|
-
for (const element of iterable) {
|
|
1502
|
-
buffer.push(element);
|
|
1503
|
-
if (predicate(element, index)) {
|
|
1504
|
-
yield buffer;
|
|
1505
|
-
buffer = [];
|
|
1506
|
-
}
|
|
1507
|
-
index++;
|
|
1508
|
-
}
|
|
1509
|
-
if (buffer.length)
|
|
1510
|
-
yield buffer;
|
|
1511
|
-
}
|
|
1512
|
-
chunkBy$1.chunkBy = chunkBy;
|
|
1513
|
-
|
|
1514
|
-
var chunk = {};
|
|
1515
|
-
|
|
1516
|
-
var hasRequiredChunk;
|
|
1517
|
-
|
|
1518
|
-
function requireChunk () {
|
|
1519
|
-
if (hasRequiredChunk) return chunk;
|
|
1520
|
-
hasRequiredChunk = 1;
|
|
1521
|
-
chunk.chunk = void 0;
|
|
1522
|
-
const go_1 = es2018$6;
|
|
1523
|
-
const errors_1 = requireEs2018();
|
|
1524
|
-
function chunk$1(iterable, size) {
|
|
1525
|
-
(0, errors_1.assert)(Number.isInteger(size), 'The parameter size must be an integer');
|
|
1526
|
-
(0, errors_1.assert)(size > 0, 'The parameter size must be greater than 0');
|
|
1527
|
-
return (0, go_1.go)(function* () {
|
|
1528
|
-
let buffer = [];
|
|
1529
|
-
for (const element of iterable) {
|
|
1530
|
-
buffer.push(element);
|
|
1531
|
-
if (buffer.length >= size) {
|
|
1532
|
-
yield buffer;
|
|
1533
|
-
buffer = [];
|
|
1534
|
-
}
|
|
1535
|
-
}
|
|
1536
|
-
if (buffer.length)
|
|
1537
|
-
yield buffer;
|
|
1538
|
-
});
|
|
1539
|
-
}
|
|
1540
|
-
chunk.chunk = chunk$1;
|
|
1541
|
-
|
|
1542
|
-
return chunk;
|
|
1543
|
-
}
|
|
1544
|
-
|
|
1545
|
-
var concatAsync$1 = {};
|
|
1546
|
-
|
|
1547
|
-
concatAsync$1.concatAsync = void 0;
|
|
1548
|
-
const types_1$i = es2018$1;
|
|
1549
|
-
const go_1$1 = es2018$6;
|
|
1550
|
-
function concatAsync(iterable, ...otherIterables) {
|
|
1551
|
-
return (0, go_1$1.go)(async function* () {
|
|
1552
|
-
for (const iter of [iterable, ...otherIterables]) {
|
|
1553
|
-
if ((0, types_1$i.isAsyncIterable)(iter)) {
|
|
1554
|
-
for await (const element of iter) {
|
|
1555
|
-
yield element;
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
else {
|
|
1559
|
-
for (const element of iter) {
|
|
1560
|
-
yield element;
|
|
1561
|
-
}
|
|
1562
|
-
}
|
|
1563
|
-
}
|
|
1564
|
-
});
|
|
1565
|
-
}
|
|
1566
|
-
concatAsync$1.concatAsync = concatAsync;
|
|
1567
|
-
|
|
1568
|
-
var concat$1 = {};
|
|
1569
|
-
|
|
1570
|
-
concat$1.concat = void 0;
|
|
1571
|
-
const go_1 = es2018$6;
|
|
1572
|
-
function concat(iterable, ...otherIterables) {
|
|
1573
|
-
return (0, go_1.go)(function* () {
|
|
1574
|
-
for (const iter of [iterable, ...otherIterables]) {
|
|
1575
|
-
yield* iter;
|
|
1576
|
-
}
|
|
1577
|
-
});
|
|
1578
|
-
}
|
|
1579
|
-
concat$1.concat = concat;
|
|
1580
|
-
|
|
1581
|
-
var dropAsync = {};
|
|
1582
|
-
|
|
1583
|
-
var utils = {};
|
|
1584
|
-
|
|
1585
|
-
utils.copyIterable = utils.copyAsyncIterable = void 0;
|
|
1586
|
-
async function* copyAsyncIterable(iterable) {
|
|
1587
|
-
for await (const element of iterable) {
|
|
1588
|
-
yield element;
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
utils.copyAsyncIterable = copyAsyncIterable;
|
|
1592
|
-
function* copyIterable(iterable) {
|
|
1593
|
-
for (const element of iterable) {
|
|
1594
|
-
yield element;
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
utils.copyIterable = copyIterable;
|
|
1598
|
-
|
|
1599
|
-
var hasRequiredDropAsync;
|
|
1600
|
-
|
|
1601
|
-
function requireDropAsync () {
|
|
1602
|
-
if (hasRequiredDropAsync) return dropAsync;
|
|
1603
|
-
hasRequiredDropAsync = 1;
|
|
1604
|
-
dropAsync.dropAsync = void 0;
|
|
1605
|
-
const go_1 = es2018$6;
|
|
1606
|
-
const utils_1 = utils;
|
|
1607
|
-
const errors_1 = requireEs2018();
|
|
1608
|
-
function dropAsync$1(iterable, count) {
|
|
1609
|
-
(0, errors_1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
|
|
1610
|
-
(0, errors_1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
|
|
1611
|
-
if (count === 0)
|
|
1612
|
-
return (0, utils_1.copyAsyncIterable)(iterable);
|
|
1613
|
-
return (0, go_1.go)(async function* () {
|
|
1614
|
-
var _a;
|
|
1615
|
-
const iterator = iterable[Symbol.asyncIterator]();
|
|
1616
|
-
let done;
|
|
1617
|
-
try {
|
|
1618
|
-
let value;
|
|
1619
|
-
while ({ value, done } = await iterator.next(), !done) {
|
|
1620
|
-
if (count <= 0)
|
|
1621
|
-
break;
|
|
1622
|
-
count--;
|
|
1623
|
-
}
|
|
1624
|
-
while (!done) {
|
|
1625
|
-
yield value;
|
|
1626
|
-
({ value, done } = await iterator.next());
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
finally {
|
|
1630
|
-
if (!done)
|
|
1631
|
-
await ((_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator));
|
|
1632
|
-
}
|
|
1633
|
-
});
|
|
1634
|
-
}
|
|
1635
|
-
dropAsync.dropAsync = dropAsync$1;
|
|
1636
|
-
|
|
1637
|
-
return dropAsync;
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
var dropRightAsync = {};
|
|
1641
|
-
|
|
1642
|
-
var hasRequiredDropRightAsync;
|
|
1643
|
-
|
|
1644
|
-
function requireDropRightAsync () {
|
|
1645
|
-
if (hasRequiredDropRightAsync) return dropRightAsync;
|
|
1646
|
-
hasRequiredDropRightAsync = 1;
|
|
1647
|
-
dropRightAsync.dropRightAsync = void 0;
|
|
1648
|
-
const go_1 = es2018$6;
|
|
1649
|
-
const utils_1 = utils;
|
|
1650
|
-
const errors_1 = requireEs2018();
|
|
1651
|
-
function dropRightAsync$1(iterable, count) {
|
|
1652
|
-
(0, errors_1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
|
|
1653
|
-
(0, errors_1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
|
|
1654
|
-
if (count === 0)
|
|
1655
|
-
return (0, utils_1.copyAsyncIterable)(iterable);
|
|
1656
|
-
return (0, go_1.go)(async function* () {
|
|
1657
|
-
const arr = await toArrayAsync(iterable);
|
|
1658
|
-
const result = arr.slice(0, -count);
|
|
1659
|
-
for (const value of result) {
|
|
1660
|
-
yield value;
|
|
1661
|
-
}
|
|
1662
|
-
});
|
|
1663
|
-
}
|
|
1664
|
-
dropRightAsync.dropRightAsync = dropRightAsync$1;
|
|
1665
|
-
async function toArrayAsync(iterable) {
|
|
1666
|
-
const result = [];
|
|
1667
|
-
for await (const element of iterable) {
|
|
1668
|
-
result.push(element);
|
|
1669
|
-
}
|
|
1670
|
-
return result;
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1673
|
-
return dropRightAsync;
|
|
1674
|
-
}
|
|
1675
|
-
|
|
1676
|
-
var dropRight = {};
|
|
1677
|
-
|
|
1678
|
-
var hasRequiredDropRight;
|
|
1679
|
-
|
|
1680
|
-
function requireDropRight () {
|
|
1681
|
-
if (hasRequiredDropRight) return dropRight;
|
|
1682
|
-
hasRequiredDropRight = 1;
|
|
1683
|
-
dropRight.dropRight = void 0;
|
|
1684
|
-
const go_1 = es2018$6;
|
|
1685
|
-
const utils_1 = utils;
|
|
1686
|
-
const errors_1 = requireEs2018();
|
|
1687
|
-
function dropRight$1(iterable, count) {
|
|
1688
|
-
(0, errors_1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
|
|
1689
|
-
(0, errors_1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
|
|
1690
|
-
if (count === 0)
|
|
1691
|
-
return (0, utils_1.copyIterable)(iterable);
|
|
1692
|
-
return (0, go_1.go)(function* () {
|
|
1693
|
-
const arr = Array.from(iterable);
|
|
1694
|
-
yield* arr.slice(0, -count);
|
|
1695
|
-
});
|
|
1696
|
-
}
|
|
1697
|
-
dropRight.dropRight = dropRight$1;
|
|
1698
|
-
|
|
1699
|
-
return dropRight;
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
var dropUntilAsync$1 = {};
|
|
1703
|
-
|
|
1704
|
-
dropUntilAsync$1.dropUntilAsync = void 0;
|
|
1705
|
-
const types_1$h = es2018$1;
|
|
1706
|
-
function dropUntilAsync(iterable, predicate) {
|
|
1707
|
-
if ((0, types_1$h.isAsyncIterable)(iterable)) {
|
|
1708
|
-
return dropUntilAsyncIterable(iterable, predicate);
|
|
1709
|
-
}
|
|
1710
|
-
else {
|
|
1711
|
-
return dropUntilIterable(iterable, predicate);
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
dropUntilAsync$1.dropUntilAsync = dropUntilAsync;
|
|
1715
|
-
async function* dropUntilAsyncIterable(iterable, predicate) {
|
|
1716
|
-
var _a;
|
|
1717
|
-
const iterator = iterable[Symbol.asyncIterator]();
|
|
1718
|
-
let done;
|
|
1719
|
-
try {
|
|
1720
|
-
let index = 0;
|
|
1721
|
-
let value;
|
|
1722
|
-
while ({ value, done } = await iterator.next(), !done) {
|
|
1723
|
-
if (await predicate(value, index++))
|
|
1724
|
-
break;
|
|
1725
|
-
}
|
|
1726
|
-
while (!done) {
|
|
1727
|
-
yield value;
|
|
1728
|
-
({ value, done } = await iterator.next());
|
|
1729
|
-
}
|
|
1730
|
-
}
|
|
1731
|
-
finally {
|
|
1732
|
-
if (!done)
|
|
1733
|
-
await ((_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator));
|
|
1734
|
-
}
|
|
1735
|
-
}
|
|
1736
|
-
async function* dropUntilIterable(iterable, predicate) {
|
|
1737
|
-
var _a;
|
|
1738
|
-
const iterator = iterable[Symbol.iterator]();
|
|
1739
|
-
let done;
|
|
1740
|
-
try {
|
|
1741
|
-
let index = 0;
|
|
1742
|
-
let value;
|
|
1743
|
-
while ({ value, done } = iterator.next(), !done) {
|
|
1744
|
-
if (await predicate(value, index++))
|
|
1745
|
-
break;
|
|
1746
|
-
}
|
|
1747
|
-
while (!done) {
|
|
1748
|
-
yield value;
|
|
1749
|
-
({ value, done } = iterator.next());
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
finally {
|
|
1753
|
-
if (!done)
|
|
1754
|
-
(_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
|
|
1755
|
-
}
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
var dropUntil$1 = {};
|
|
1759
|
-
|
|
1760
|
-
dropUntil$1.dropUntil = void 0;
|
|
1761
|
-
function* dropUntil(iterable, predicate) {
|
|
1762
|
-
var _a;
|
|
1763
|
-
const iterator = iterable[Symbol.iterator]();
|
|
1764
|
-
let done;
|
|
1765
|
-
try {
|
|
1766
|
-
let index = 0;
|
|
1767
|
-
let value;
|
|
1768
|
-
while ({ value, done } = iterator.next(), !done) {
|
|
1769
|
-
if (predicate(value, index++))
|
|
1770
|
-
break;
|
|
1771
|
-
}
|
|
1772
|
-
while (!done) {
|
|
1773
|
-
yield value;
|
|
1774
|
-
({ value, done } = iterator.next());
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
finally {
|
|
1778
|
-
if (!done)
|
|
1779
|
-
(_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1782
|
-
dropUntil$1.dropUntil = dropUntil;
|
|
1783
|
-
|
|
1784
|
-
var drop = {};
|
|
1785
|
-
|
|
1786
|
-
var hasRequiredDrop;
|
|
1787
|
-
|
|
1788
|
-
function requireDrop () {
|
|
1789
|
-
if (hasRequiredDrop) return drop;
|
|
1790
|
-
hasRequiredDrop = 1;
|
|
1791
|
-
drop.drop = void 0;
|
|
1792
|
-
const go_1 = es2018$6;
|
|
1793
|
-
const utils_1 = utils;
|
|
1794
|
-
const errors_1 = requireEs2018();
|
|
1795
|
-
function drop$1(iterable, count) {
|
|
1796
|
-
(0, errors_1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
|
|
1797
|
-
(0, errors_1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
|
|
1798
|
-
if (count === 0)
|
|
1799
|
-
return (0, utils_1.copyIterable)(iterable);
|
|
1800
|
-
return (0, go_1.go)(function* () {
|
|
1801
|
-
var _a;
|
|
1802
|
-
const iterator = iterable[Symbol.iterator]();
|
|
1803
|
-
let done;
|
|
1804
|
-
try {
|
|
1805
|
-
let value;
|
|
1806
|
-
while ({ value, done } = iterator.next(), !done) {
|
|
1807
|
-
if (count <= 0)
|
|
1808
|
-
break;
|
|
1809
|
-
count--;
|
|
1810
|
-
}
|
|
1811
|
-
while (!done) {
|
|
1812
|
-
yield value;
|
|
1813
|
-
({ value, done } = iterator.next());
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
finally {
|
|
1817
|
-
if (!done)
|
|
1818
|
-
(_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
|
|
1819
|
-
}
|
|
1820
|
-
});
|
|
1821
|
-
}
|
|
1822
|
-
drop.drop = drop$1;
|
|
1823
|
-
|
|
1824
|
-
return drop;
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
var filterAsync$1 = {};
|
|
1828
|
-
|
|
1829
|
-
filterAsync$1.filterAsync = void 0;
|
|
1830
|
-
const types_1$g = es2018$1;
|
|
1831
|
-
function filterAsync(iterable, predicate) {
|
|
1832
|
-
if ((0, types_1$g.isAsyncIterable)(iterable)) {
|
|
1833
|
-
return filterAsyncIterable(iterable, predicate);
|
|
1834
|
-
}
|
|
1835
|
-
else {
|
|
1836
|
-
return filterIterable(iterable, predicate);
|
|
1837
|
-
}
|
|
1838
|
-
}
|
|
1839
|
-
filterAsync$1.filterAsync = filterAsync;
|
|
1840
|
-
async function* filterAsyncIterable(iterable, predicate) {
|
|
1841
|
-
let index = 0;
|
|
1842
|
-
for await (const element of iterable) {
|
|
1843
|
-
if (await predicate(element, index))
|
|
1844
|
-
yield element;
|
|
1845
|
-
index++;
|
|
1846
|
-
}
|
|
1847
|
-
}
|
|
1848
|
-
async function* filterIterable(iterable, predicate) {
|
|
1849
|
-
let index = 0;
|
|
1850
|
-
for (const element of iterable) {
|
|
1851
|
-
if (await predicate(element, index))
|
|
1852
|
-
yield element;
|
|
1853
|
-
index++;
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
var filter$1 = {};
|
|
1858
|
-
|
|
1859
|
-
filter$1.filter = void 0;
|
|
1860
|
-
function* filter(iterable, predicate) {
|
|
1861
|
-
let index = 0;
|
|
1862
|
-
for (const element of iterable) {
|
|
1863
|
-
if (predicate(element, index))
|
|
1864
|
-
yield element;
|
|
1865
|
-
index++;
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
filter$1.filter = filter;
|
|
1869
|
-
|
|
1870
|
-
var flattenAsync = {};
|
|
1871
|
-
|
|
1872
|
-
var flattenDeepAsync = {};
|
|
1873
|
-
|
|
1874
|
-
var flattenByAsync$1 = {};
|
|
1875
|
-
|
|
1876
|
-
flattenByAsync$1.flattenByAsync = void 0;
|
|
1877
|
-
const types_1$f = es2018$1;
|
|
1878
|
-
function flattenByAsync(iterable, predicate) {
|
|
1879
|
-
if ((0, types_1$f.isAsyncIterable)(iterable)) {
|
|
1880
|
-
return flattenByAsyncIterable(iterable, predicate);
|
|
1881
|
-
}
|
|
1882
|
-
else {
|
|
1883
|
-
return flattenByIterable(iterable, predicate);
|
|
1884
|
-
}
|
|
1885
|
-
}
|
|
1886
|
-
flattenByAsync$1.flattenByAsync = flattenByAsync;
|
|
1887
|
-
async function* flattenByAsyncIterable(iterable, predicate) {
|
|
1888
|
-
const level = 1;
|
|
1889
|
-
for await (const element of iterable) {
|
|
1890
|
-
if (isFiniteIterable$1(element) && await predicate(element, level)) {
|
|
1891
|
-
yield* flatten$2(element, predicate, level + 1);
|
|
1892
|
-
}
|
|
1893
|
-
else {
|
|
1894
|
-
yield element;
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
|
-
}
|
|
1898
|
-
function flattenByIterable(iterable, predicate) {
|
|
1899
|
-
return flatten$2(iterable, predicate, 1);
|
|
1900
|
-
}
|
|
1901
|
-
async function* flatten$2(iterable, predicate, level) {
|
|
1902
|
-
for (const element of iterable) {
|
|
1903
|
-
if (isFiniteIterable$1(element) && await predicate(element, level)) {
|
|
1904
|
-
yield* flatten$2(element, predicate, level + 1);
|
|
1905
|
-
}
|
|
1906
|
-
else {
|
|
1907
|
-
yield element;
|
|
1908
|
-
}
|
|
1909
|
-
}
|
|
1910
|
-
}
|
|
1911
|
-
function isFiniteIterable$1(val) {
|
|
1912
|
-
return (0, types_1$f.isIterable)(val) && (0, types_1$f.isntChar)(val);
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
var hasRequiredFlattenDeepAsync;
|
|
1916
|
-
|
|
1917
|
-
function requireFlattenDeepAsync () {
|
|
1918
|
-
if (hasRequiredFlattenDeepAsync) return flattenDeepAsync;
|
|
1919
|
-
hasRequiredFlattenDeepAsync = 1;
|
|
1920
|
-
flattenDeepAsync.flattenDeepAsync = void 0;
|
|
1921
|
-
const flatten_by_async_1 = flattenByAsync$1;
|
|
1922
|
-
const errors_1 = requireEs2018();
|
|
1923
|
-
function flattenDeepAsync$1(iterable, depth = Infinity) {
|
|
1924
|
-
(0, errors_1.assert)(depth === Infinity || Number.isInteger(depth), 'The parameter depth must be an integer');
|
|
1925
|
-
(0, errors_1.assert)(depth >= 0, 'The parameter depth must be greater than or equal to 0');
|
|
1926
|
-
return (0, flatten_by_async_1.flattenByAsync)(iterable, (_, level) => level <= depth);
|
|
1927
|
-
}
|
|
1928
|
-
flattenDeepAsync.flattenDeepAsync = flattenDeepAsync$1;
|
|
1929
|
-
|
|
1930
|
-
return flattenDeepAsync;
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
|
-
var hasRequiredFlattenAsync;
|
|
1934
|
-
|
|
1935
|
-
function requireFlattenAsync () {
|
|
1936
|
-
if (hasRequiredFlattenAsync) return flattenAsync;
|
|
1937
|
-
hasRequiredFlattenAsync = 1;
|
|
1938
|
-
flattenAsync.flattenAsync = void 0;
|
|
1939
|
-
const flatten_deep_async_1 = requireFlattenDeepAsync();
|
|
1940
|
-
function flattenAsync$1(iterable) {
|
|
1941
|
-
return (0, flatten_deep_async_1.flattenDeepAsync)(iterable, 1);
|
|
1942
|
-
}
|
|
1943
|
-
flattenAsync.flattenAsync = flattenAsync$1;
|
|
1944
|
-
|
|
1945
|
-
return flattenAsync;
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
|
-
var flattenBy$1 = {};
|
|
1949
|
-
|
|
1950
|
-
flattenBy$1.flattenBy = void 0;
|
|
1951
|
-
const types_1$e = es2018$1;
|
|
1952
|
-
function flattenBy(iterable, predicate) {
|
|
1953
|
-
return flatten$1(iterable, predicate, 1);
|
|
1954
|
-
}
|
|
1955
|
-
flattenBy$1.flattenBy = flattenBy;
|
|
1956
|
-
function* flatten$1(iterable, predicate, level) {
|
|
1957
|
-
for (const element of iterable) {
|
|
1958
|
-
if (isFiniteIterable(element) && predicate(element, level)) {
|
|
1959
|
-
yield* flatten$1(element, predicate, level + 1);
|
|
1960
|
-
}
|
|
1961
|
-
else {
|
|
1962
|
-
yield element;
|
|
1963
|
-
}
|
|
1964
|
-
}
|
|
1965
|
-
}
|
|
1966
|
-
function isFiniteIterable(val) {
|
|
1967
|
-
return (0, types_1$e.isIterable)(val) && (0, types_1$e.isntChar)(val);
|
|
1968
|
-
}
|
|
1969
|
-
|
|
1970
|
-
var flattenDeep = {};
|
|
1971
|
-
|
|
1972
|
-
var hasRequiredFlattenDeep;
|
|
1973
|
-
|
|
1974
|
-
function requireFlattenDeep () {
|
|
1975
|
-
if (hasRequiredFlattenDeep) return flattenDeep;
|
|
1976
|
-
hasRequiredFlattenDeep = 1;
|
|
1977
|
-
flattenDeep.flattenDeep = void 0;
|
|
1978
|
-
const flatten_by_1 = flattenBy$1;
|
|
1979
|
-
const errors_1 = requireEs2018();
|
|
1980
|
-
function flattenDeep$1(iterable, depth = Infinity) {
|
|
1981
|
-
(0, errors_1.assert)(depth === Infinity || Number.isInteger(depth), 'The parameter depth must be an integer');
|
|
1982
|
-
(0, errors_1.assert)(depth >= 0, 'The parameter depth must be greater than or equal to 0');
|
|
1983
|
-
return (0, flatten_by_1.flattenBy)(iterable, (_, level) => level <= depth);
|
|
1984
|
-
}
|
|
1985
|
-
flattenDeep.flattenDeep = flattenDeep$1;
|
|
1986
|
-
|
|
1987
|
-
return flattenDeep;
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1990
|
-
var flatten = {};
|
|
1991
|
-
|
|
1992
|
-
var hasRequiredFlatten;
|
|
1993
|
-
|
|
1994
|
-
function requireFlatten () {
|
|
1995
|
-
if (hasRequiredFlatten) return flatten;
|
|
1996
|
-
hasRequiredFlatten = 1;
|
|
1997
|
-
flatten.flatten = void 0;
|
|
1998
|
-
const flatten_deep_1 = requireFlattenDeep();
|
|
1999
|
-
function flatten$1(iterable) {
|
|
2000
|
-
return (0, flatten_deep_1.flattenDeep)(iterable, 1);
|
|
2001
|
-
}
|
|
2002
|
-
flatten.flatten = flatten$1;
|
|
2003
|
-
|
|
2004
|
-
return flatten;
|
|
2005
|
-
}
|
|
2006
|
-
|
|
2007
|
-
var mapAsync$1 = {};
|
|
2008
|
-
|
|
2009
|
-
mapAsync$1.mapAsync = void 0;
|
|
2010
|
-
const types_1$d = es2018$1;
|
|
2011
|
-
function mapAsync(iterable, fn) {
|
|
2012
|
-
if ((0, types_1$d.isAsyncIterable)(iterable)) {
|
|
2013
|
-
return mapAsyncIterable(iterable, fn);
|
|
2014
|
-
}
|
|
2015
|
-
else {
|
|
2016
|
-
return mapIterable(iterable, fn);
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
mapAsync$1.mapAsync = mapAsync;
|
|
2020
|
-
async function* mapAsyncIterable(iterable, fn) {
|
|
2021
|
-
let index = 0;
|
|
2022
|
-
for await (const element of iterable) {
|
|
2023
|
-
yield await fn(element, index);
|
|
2024
|
-
index++;
|
|
2025
|
-
}
|
|
2026
|
-
}
|
|
2027
|
-
async function* mapIterable(iterable, fn) {
|
|
2028
|
-
let index = 0;
|
|
2029
|
-
for (const element of iterable) {
|
|
2030
|
-
yield await fn(element, index);
|
|
2031
|
-
index++;
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
|
|
2035
|
-
var map$1 = {};
|
|
2036
|
-
|
|
2037
|
-
map$1.map = void 0;
|
|
2038
|
-
function* map(iterable, fn) {
|
|
2039
|
-
let index = 0;
|
|
2040
|
-
for (const element of iterable) {
|
|
2041
|
-
yield fn(element, index);
|
|
2042
|
-
index++;
|
|
2043
|
-
}
|
|
2044
|
-
}
|
|
2045
|
-
map$1.map = map;
|
|
2046
|
-
|
|
2047
|
-
var repeatAsync = {};
|
|
2048
|
-
|
|
2049
|
-
var hasRequiredRepeatAsync;
|
|
2050
|
-
|
|
2051
|
-
function requireRepeatAsync () {
|
|
2052
|
-
if (hasRequiredRepeatAsync) return repeatAsync;
|
|
2053
|
-
hasRequiredRepeatAsync = 1;
|
|
2054
|
-
repeatAsync.repeatAsync = void 0;
|
|
2055
|
-
const go_1 = es2018$6;
|
|
2056
|
-
const errors_1 = requireEs2018();
|
|
2057
|
-
function repeatAsync$1(iterable, times) {
|
|
2058
|
-
(0, errors_1.assert)(times === Infinity || Number.isInteger(times), 'The parameter times must be an integer');
|
|
2059
|
-
(0, errors_1.assert)(times >= 0, 'The parameter times must be greater than or equal to 0');
|
|
2060
|
-
if (times === Infinity)
|
|
2061
|
-
warnInfiniteLoop();
|
|
2062
|
-
return (0, go_1.go)(async function* () {
|
|
2063
|
-
const cache = [];
|
|
2064
|
-
if (times > 0) {
|
|
2065
|
-
for await (const element of iterable) {
|
|
2066
|
-
yield element;
|
|
2067
|
-
cache.push(element);
|
|
2068
|
-
}
|
|
2069
|
-
times--;
|
|
2070
|
-
}
|
|
2071
|
-
while (times > 0) {
|
|
2072
|
-
yield* cache;
|
|
2073
|
-
times--;
|
|
2074
|
-
}
|
|
2075
|
-
});
|
|
2076
|
-
}
|
|
2077
|
-
repeatAsync.repeatAsync = repeatAsync$1;
|
|
2078
|
-
function warnInfiniteLoop() {
|
|
2079
|
-
if (isProduction())
|
|
2080
|
-
return;
|
|
2081
|
-
console.warn('When iterable has no elements and times is Infinity, repeat() will be in dead loop');
|
|
2082
|
-
}
|
|
2083
|
-
function isProduction() {
|
|
2084
|
-
return process.env.NODE_ENV === 'production';
|
|
2085
|
-
}
|
|
2086
|
-
|
|
2087
|
-
return repeatAsync;
|
|
2088
|
-
}
|
|
2089
|
-
|
|
2090
|
-
var repeat = {};
|
|
2091
|
-
|
|
2092
|
-
var hasRequiredRepeat;
|
|
2093
|
-
|
|
2094
|
-
function requireRepeat () {
|
|
2095
|
-
if (hasRequiredRepeat) return repeat;
|
|
2096
|
-
hasRequiredRepeat = 1;
|
|
2097
|
-
repeat.repeat = void 0;
|
|
2098
|
-
const go_1 = es2018$6;
|
|
2099
|
-
const errors_1 = requireEs2018();
|
|
2100
|
-
function repeat$1(iterable, times) {
|
|
2101
|
-
(0, errors_1.assert)(times === Infinity || Number.isInteger(times), 'The parameter times must be an integer');
|
|
2102
|
-
(0, errors_1.assert)(times >= 0, 'The parameter times must be greater than or equal to 0');
|
|
2103
|
-
if (times === Infinity)
|
|
2104
|
-
warnInfiniteLoop();
|
|
2105
|
-
return (0, go_1.go)(function* () {
|
|
2106
|
-
const cache = [];
|
|
2107
|
-
if (times > 0) {
|
|
2108
|
-
for (const element of iterable) {
|
|
2109
|
-
yield element;
|
|
2110
|
-
cache.push(element);
|
|
2111
|
-
}
|
|
2112
|
-
times--;
|
|
2113
|
-
}
|
|
2114
|
-
while (times > 0) {
|
|
2115
|
-
yield* cache;
|
|
2116
|
-
times--;
|
|
2117
|
-
}
|
|
2118
|
-
});
|
|
2119
|
-
}
|
|
2120
|
-
repeat.repeat = repeat$1;
|
|
2121
|
-
function warnInfiniteLoop() {
|
|
2122
|
-
if (isProduction())
|
|
2123
|
-
return;
|
|
2124
|
-
console.warn('When iterable has no elements and times is Infinity, repeat() will be in dead loop');
|
|
2125
|
-
}
|
|
2126
|
-
function isProduction() {
|
|
2127
|
-
return process.env.NODE_ENV === 'production';
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
return repeat;
|
|
2131
|
-
}
|
|
2132
|
-
|
|
2133
|
-
var sliceAsync = {};
|
|
2134
|
-
|
|
2135
|
-
var hasRequiredSliceAsync;
|
|
2136
|
-
|
|
2137
|
-
function requireSliceAsync () {
|
|
2138
|
-
if (hasRequiredSliceAsync) return sliceAsync;
|
|
2139
|
-
hasRequiredSliceAsync = 1;
|
|
2140
|
-
sliceAsync.sliceAsync = void 0;
|
|
2141
|
-
const go_1 = es2018$6;
|
|
2142
|
-
const errors_1 = requireEs2018();
|
|
2143
|
-
function sliceAsync$1(iterable, start, end = Infinity) {
|
|
2144
|
-
(0, errors_1.assert)(Number.isInteger(start), 'The parameter start must be an integer');
|
|
2145
|
-
(0, errors_1.assert)(start >= 0, 'The parameter start must be greater than or equal to 0');
|
|
2146
|
-
(0, errors_1.assert)(Number.isInteger(end), 'The parameter end must be an integer');
|
|
2147
|
-
(0, errors_1.assert)(end >= start, 'The parameter end must be greater than or equal to start');
|
|
2148
|
-
return (0, go_1.go)(async function* () {
|
|
2149
|
-
let index = 0;
|
|
2150
|
-
for await (const element of iterable) {
|
|
2151
|
-
if (index >= end)
|
|
2152
|
-
break;
|
|
2153
|
-
if (index >= start)
|
|
2154
|
-
yield element;
|
|
2155
|
-
index++;
|
|
2156
|
-
}
|
|
2157
|
-
});
|
|
2158
|
-
}
|
|
2159
|
-
sliceAsync.sliceAsync = sliceAsync$1;
|
|
2160
|
-
|
|
2161
|
-
return sliceAsync;
|
|
2162
|
-
}
|
|
2163
|
-
|
|
2164
|
-
var slice = {};
|
|
2165
|
-
|
|
2166
|
-
var hasRequiredSlice;
|
|
2167
|
-
|
|
2168
|
-
function requireSlice () {
|
|
2169
|
-
if (hasRequiredSlice) return slice;
|
|
2170
|
-
hasRequiredSlice = 1;
|
|
2171
|
-
slice.slice = void 0;
|
|
2172
|
-
const go_1 = es2018$6;
|
|
2173
|
-
const errors_1 = requireEs2018();
|
|
2174
|
-
function slice$1(iterable, start, end = Infinity) {
|
|
2175
|
-
(0, errors_1.assert)(Number.isInteger(start), 'The parameter start must be an integer');
|
|
2176
|
-
(0, errors_1.assert)(start >= 0, 'The parameter start must be greater than or equal to 0');
|
|
2177
|
-
(0, errors_1.assert)(Number.isInteger(end), 'The parameter end must be an integer');
|
|
2178
|
-
(0, errors_1.assert)(end >= start, 'The parameter end must be greater than or equal to start');
|
|
2179
|
-
return (0, go_1.go)(function* () {
|
|
2180
|
-
let index = 0;
|
|
2181
|
-
for (const element of iterable) {
|
|
2182
|
-
if (index >= end)
|
|
2183
|
-
break;
|
|
2184
|
-
if (index >= start)
|
|
2185
|
-
yield element;
|
|
2186
|
-
index++;
|
|
2187
|
-
}
|
|
2188
|
-
});
|
|
2189
|
-
}
|
|
2190
|
-
slice.slice = slice$1;
|
|
2191
|
-
|
|
2192
|
-
return slice;
|
|
2193
|
-
}
|
|
2194
|
-
|
|
2195
|
-
var splitAsync$1 = {};
|
|
2196
|
-
|
|
2197
|
-
splitAsync$1.splitAsync = void 0;
|
|
2198
|
-
async function* splitAsync(iterable, separator) {
|
|
2199
|
-
let buffer = [];
|
|
2200
|
-
for await (const element of iterable) {
|
|
2201
|
-
if (element === separator) {
|
|
2202
|
-
yield buffer;
|
|
2203
|
-
buffer = [];
|
|
2204
|
-
}
|
|
2205
|
-
else {
|
|
2206
|
-
buffer.push(element);
|
|
2207
|
-
}
|
|
2208
|
-
}
|
|
2209
|
-
yield buffer;
|
|
2210
|
-
}
|
|
2211
|
-
splitAsync$1.splitAsync = splitAsync;
|
|
2212
|
-
|
|
2213
|
-
var splitByAsync$1 = {};
|
|
2214
|
-
|
|
2215
|
-
splitByAsync$1.splitByAsync = void 0;
|
|
2216
|
-
const types_1$c = es2018$1;
|
|
2217
|
-
function splitByAsync(iterable, predicate) {
|
|
2218
|
-
if ((0, types_1$c.isAsyncIterable)(iterable)) {
|
|
2219
|
-
return splitByAsyncIterable(iterable, predicate);
|
|
2220
|
-
}
|
|
2221
|
-
else {
|
|
2222
|
-
return splitByIterable(iterable, predicate);
|
|
2223
|
-
}
|
|
2224
|
-
}
|
|
2225
|
-
splitByAsync$1.splitByAsync = splitByAsync;
|
|
2226
|
-
async function* splitByIterable(iterable, predicate) {
|
|
2227
|
-
let buffer = [];
|
|
2228
|
-
let index = 0;
|
|
2229
|
-
for (const element of iterable) {
|
|
2230
|
-
if (await predicate(element, index)) {
|
|
2231
|
-
yield buffer;
|
|
2232
|
-
buffer = [];
|
|
2233
|
-
}
|
|
2234
|
-
else {
|
|
2235
|
-
buffer.push(element);
|
|
2236
|
-
}
|
|
2237
|
-
index++;
|
|
2238
|
-
}
|
|
2239
|
-
yield buffer;
|
|
2240
|
-
}
|
|
2241
|
-
async function* splitByAsyncIterable(iterable, predicate) {
|
|
2242
|
-
let buffer = [];
|
|
2243
|
-
let index = 0;
|
|
2244
|
-
for await (const element of iterable) {
|
|
2245
|
-
if (await predicate(element, index)) {
|
|
2246
|
-
yield buffer;
|
|
2247
|
-
buffer = [];
|
|
2248
|
-
}
|
|
2249
|
-
else {
|
|
2250
|
-
buffer.push(element);
|
|
2251
|
-
}
|
|
2252
|
-
index++;
|
|
2253
|
-
}
|
|
2254
|
-
yield buffer;
|
|
2255
|
-
}
|
|
2256
|
-
|
|
2257
|
-
var splitBy$1 = {};
|
|
2258
|
-
|
|
2259
|
-
splitBy$1.splitBy = void 0;
|
|
2260
|
-
function* splitBy(iterable, predicate) {
|
|
2261
|
-
let buffer = [];
|
|
2262
|
-
let index = 0;
|
|
2263
|
-
for (const element of iterable) {
|
|
2264
|
-
if (predicate(element, index)) {
|
|
2265
|
-
yield buffer;
|
|
2266
|
-
buffer = [];
|
|
2267
|
-
}
|
|
2268
|
-
else {
|
|
2269
|
-
buffer.push(element);
|
|
2270
|
-
}
|
|
2271
|
-
index++;
|
|
2272
|
-
}
|
|
2273
|
-
yield buffer;
|
|
2274
|
-
}
|
|
2275
|
-
splitBy$1.splitBy = splitBy;
|
|
2276
|
-
|
|
2277
|
-
var split$1 = {};
|
|
2278
|
-
|
|
2279
|
-
split$1.split = void 0;
|
|
2280
|
-
function* split(iterable, separator) {
|
|
2281
|
-
let buffer = [];
|
|
2282
|
-
for (const element of iterable) {
|
|
2283
|
-
if (element === separator) {
|
|
2284
|
-
yield buffer;
|
|
2285
|
-
buffer = [];
|
|
2286
|
-
}
|
|
2287
|
-
else {
|
|
2288
|
-
buffer.push(element);
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
yield buffer;
|
|
2292
|
-
}
|
|
2293
|
-
split$1.split = split;
|
|
2294
|
-
|
|
2295
|
-
var takeAsync = {};
|
|
2296
|
-
|
|
2297
|
-
var hasRequiredTakeAsync;
|
|
2298
|
-
|
|
2299
|
-
function requireTakeAsync () {
|
|
2300
|
-
if (hasRequiredTakeAsync) return takeAsync;
|
|
2301
|
-
hasRequiredTakeAsync = 1;
|
|
2302
|
-
takeAsync.takeAsync = void 0;
|
|
2303
|
-
const go_1 = es2018$6;
|
|
2304
|
-
const errors_1 = requireEs2018();
|
|
2305
|
-
function takeAsync$1(iterable, count) {
|
|
2306
|
-
(0, errors_1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
|
|
2307
|
-
(0, errors_1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
|
|
2308
|
-
return (0, go_1.go)(async function* () {
|
|
2309
|
-
if (count === 0)
|
|
2310
|
-
return;
|
|
2311
|
-
for await (const element of iterable) {
|
|
2312
|
-
yield element;
|
|
2313
|
-
count--;
|
|
2314
|
-
if (count === 0)
|
|
2315
|
-
break;
|
|
2316
|
-
}
|
|
2317
|
-
});
|
|
2318
|
-
}
|
|
2319
|
-
takeAsync.takeAsync = takeAsync$1;
|
|
2320
|
-
|
|
2321
|
-
return takeAsync;
|
|
2322
|
-
}
|
|
2323
|
-
|
|
2324
|
-
var takeRightAsync = {};
|
|
2325
|
-
|
|
2326
|
-
var hasRequiredTakeRightAsync;
|
|
2327
|
-
|
|
2328
|
-
function requireTakeRightAsync () {
|
|
2329
|
-
if (hasRequiredTakeRightAsync) return takeRightAsync;
|
|
2330
|
-
hasRequiredTakeRightAsync = 1;
|
|
2331
|
-
takeRightAsync.takeRightAsync = void 0;
|
|
2332
|
-
const go_1 = es2018$6;
|
|
2333
|
-
const errors_1 = requireEs2018();
|
|
2334
|
-
function takeRightAsync$1(iterable, count) {
|
|
2335
|
-
(0, errors_1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
|
|
2336
|
-
(0, errors_1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
|
|
2337
|
-
return (0, go_1.go)(async function* () {
|
|
2338
|
-
var _a;
|
|
2339
|
-
const iterator = iterable[Symbol.asyncIterator]();
|
|
2340
|
-
let done;
|
|
2341
|
-
try {
|
|
2342
|
-
const buffer = [];
|
|
2343
|
-
let value;
|
|
2344
|
-
while ({ value, done } = await iterator.next(), !done) {
|
|
2345
|
-
buffer.push(value);
|
|
2346
|
-
if (buffer.length > count)
|
|
2347
|
-
buffer.shift();
|
|
2348
|
-
}
|
|
2349
|
-
yield* buffer;
|
|
2350
|
-
}
|
|
2351
|
-
finally {
|
|
2352
|
-
if (!done)
|
|
2353
|
-
await ((_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator));
|
|
2354
|
-
}
|
|
2355
|
-
});
|
|
2356
|
-
}
|
|
2357
|
-
takeRightAsync.takeRightAsync = takeRightAsync$1;
|
|
2358
|
-
|
|
2359
|
-
return takeRightAsync;
|
|
2360
|
-
}
|
|
2361
|
-
|
|
2362
|
-
var takeRight = {};
|
|
2363
|
-
|
|
2364
|
-
var hasRequiredTakeRight;
|
|
2365
|
-
|
|
2366
|
-
function requireTakeRight () {
|
|
2367
|
-
if (hasRequiredTakeRight) return takeRight;
|
|
2368
|
-
hasRequiredTakeRight = 1;
|
|
2369
|
-
takeRight.takeRight = void 0;
|
|
2370
|
-
const go_1 = es2018$6;
|
|
2371
|
-
const errors_1 = requireEs2018();
|
|
2372
|
-
function takeRight$1(iterable, count) {
|
|
2373
|
-
(0, errors_1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
|
|
2374
|
-
(0, errors_1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
|
|
2375
|
-
return (0, go_1.go)(function* () {
|
|
2376
|
-
var _a;
|
|
2377
|
-
const iterator = iterable[Symbol.iterator]();
|
|
2378
|
-
let done;
|
|
2379
|
-
try {
|
|
2380
|
-
const buffer = [];
|
|
2381
|
-
let value;
|
|
2382
|
-
while ({ value, done } = iterator.next(), !done) {
|
|
2383
|
-
buffer.push(value);
|
|
2384
|
-
if (buffer.length > count)
|
|
2385
|
-
buffer.shift();
|
|
2386
|
-
}
|
|
2387
|
-
yield* buffer;
|
|
2388
|
-
}
|
|
2389
|
-
finally {
|
|
2390
|
-
if (!done)
|
|
2391
|
-
(_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
|
|
2392
|
-
}
|
|
2393
|
-
});
|
|
2394
|
-
}
|
|
2395
|
-
takeRight.takeRight = takeRight$1;
|
|
2396
|
-
|
|
2397
|
-
return takeRight;
|
|
2398
|
-
}
|
|
2399
|
-
|
|
2400
|
-
var takeUntilAsync$1 = {};
|
|
2401
|
-
|
|
2402
|
-
takeUntilAsync$1.takeUntilAsync = void 0;
|
|
2403
|
-
const types_1$b = es2018$1;
|
|
2404
|
-
function takeUntilAsync(iterable, predicate) {
|
|
2405
|
-
if ((0, types_1$b.isAsyncIterable)(iterable)) {
|
|
2406
|
-
return takeUntilAsyncIterable(iterable, predicate);
|
|
2407
|
-
}
|
|
2408
|
-
else {
|
|
2409
|
-
return takeUntilIterable(iterable, predicate);
|
|
2410
|
-
}
|
|
2411
|
-
}
|
|
2412
|
-
takeUntilAsync$1.takeUntilAsync = takeUntilAsync;
|
|
2413
|
-
async function* takeUntilAsyncIterable(iterable, predicate) {
|
|
2414
|
-
let index = 0;
|
|
2415
|
-
for await (const element of iterable) {
|
|
2416
|
-
if (await predicate(element, index))
|
|
2417
|
-
break;
|
|
2418
|
-
yield element;
|
|
2419
|
-
index++;
|
|
2420
|
-
}
|
|
2421
|
-
}
|
|
2422
|
-
async function* takeUntilIterable(iterable, predicate) {
|
|
2423
|
-
let index = 0;
|
|
2424
|
-
for (const element of iterable) {
|
|
2425
|
-
if (await predicate(element, index))
|
|
2426
|
-
break;
|
|
2427
|
-
yield element;
|
|
2428
|
-
index++;
|
|
2429
|
-
}
|
|
2430
|
-
}
|
|
2431
|
-
|
|
2432
|
-
var takeUntil$1 = {};
|
|
2433
|
-
|
|
2434
|
-
takeUntil$1.takeUntil = void 0;
|
|
2435
|
-
function* takeUntil(iterable, predicate) {
|
|
2436
|
-
let index = 0;
|
|
2437
|
-
for (const element of iterable) {
|
|
2438
|
-
if (predicate(element, index))
|
|
2439
|
-
break;
|
|
2440
|
-
yield element;
|
|
2441
|
-
index++;
|
|
2442
|
-
}
|
|
2443
|
-
}
|
|
2444
|
-
takeUntil$1.takeUntil = takeUntil;
|
|
2445
|
-
|
|
2446
|
-
var take = {};
|
|
2447
|
-
|
|
2448
|
-
var hasRequiredTake;
|
|
2449
|
-
|
|
2450
|
-
function requireTake () {
|
|
2451
|
-
if (hasRequiredTake) return take;
|
|
2452
|
-
hasRequiredTake = 1;
|
|
2453
|
-
take.take = void 0;
|
|
2454
|
-
const go_1 = es2018$6;
|
|
2455
|
-
const errors_1 = requireEs2018();
|
|
2456
|
-
function take$1(iterable, count) {
|
|
2457
|
-
(0, errors_1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
|
|
2458
|
-
(0, errors_1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
|
|
2459
|
-
return (0, go_1.go)(function* () {
|
|
2460
|
-
if (count === 0)
|
|
2461
|
-
return;
|
|
2462
|
-
for (const element of iterable) {
|
|
2463
|
-
yield element;
|
|
2464
|
-
count--;
|
|
2465
|
-
if (count === 0)
|
|
2466
|
-
break;
|
|
2467
|
-
}
|
|
2468
|
-
});
|
|
2469
|
-
}
|
|
2470
|
-
take.take = take$1;
|
|
2471
|
-
|
|
2472
|
-
return take;
|
|
2473
|
-
}
|
|
2474
|
-
|
|
2475
|
-
var tapAsync$1 = {};
|
|
2476
|
-
|
|
2477
|
-
tapAsync$1.tapAsync = void 0;
|
|
2478
|
-
const types_1$a = es2018$1;
|
|
2479
|
-
function tapAsync(iterable, fn) {
|
|
2480
|
-
if ((0, types_1$a.isAsyncIterable)(iterable)) {
|
|
2481
|
-
return tapAsyncIterable(iterable, fn);
|
|
2482
|
-
}
|
|
2483
|
-
else {
|
|
2484
|
-
return tapIterable(iterable, fn);
|
|
2485
|
-
}
|
|
2486
|
-
}
|
|
2487
|
-
tapAsync$1.tapAsync = tapAsync;
|
|
2488
|
-
async function* tapIterable(iterable, fn) {
|
|
2489
|
-
let index = 0;
|
|
2490
|
-
for (const element of iterable) {
|
|
2491
|
-
await fn(element, index);
|
|
2492
|
-
yield element;
|
|
2493
|
-
index++;
|
|
2494
|
-
}
|
|
2495
|
-
}
|
|
2496
|
-
async function* tapAsyncIterable(iterable, fn) {
|
|
2497
|
-
let index = 0;
|
|
2498
|
-
for await (const element of iterable) {
|
|
2499
|
-
await fn(element, index);
|
|
2500
|
-
yield element;
|
|
2501
|
-
index++;
|
|
2502
|
-
}
|
|
2503
|
-
}
|
|
2504
|
-
|
|
2505
|
-
var tap$1 = {};
|
|
2506
|
-
|
|
2507
|
-
tap$1.tap = void 0;
|
|
2508
|
-
function* tap(iterable, fn) {
|
|
2509
|
-
let index = 0;
|
|
2510
|
-
for (const element of iterable) {
|
|
2511
|
-
fn(element, index);
|
|
2512
|
-
yield element;
|
|
2513
|
-
index++;
|
|
2514
|
-
}
|
|
2515
|
-
}
|
|
2516
|
-
tap$1.tap = tap;
|
|
2517
|
-
|
|
2518
|
-
var toAsyncIterable$1 = {};
|
|
2519
|
-
|
|
2520
|
-
toAsyncIterable$1.toAsyncIterable = void 0;
|
|
2521
|
-
async function* toAsyncIterable(iterable) {
|
|
2522
|
-
for (const value of iterable) {
|
|
2523
|
-
yield value;
|
|
2524
|
-
}
|
|
2525
|
-
}
|
|
2526
|
-
toAsyncIterable$1.toAsyncIterable = toAsyncIterable;
|
|
2527
|
-
|
|
2528
|
-
var transformAsync$1 = {};
|
|
2529
|
-
|
|
2530
|
-
transformAsync$1.transformAsync = void 0;
|
|
2531
|
-
async function* transformAsync(iterable, transformer) {
|
|
2532
|
-
yield* transformer(iterable);
|
|
2533
|
-
}
|
|
2534
|
-
transformAsync$1.transformAsync = transformAsync;
|
|
2535
|
-
|
|
2536
|
-
var transform$1 = {};
|
|
2537
|
-
|
|
2538
|
-
transform$1.transform = void 0;
|
|
2539
|
-
function* transform(iterable, transformer) {
|
|
2540
|
-
yield* transformer(iterable);
|
|
2541
|
-
}
|
|
2542
|
-
transform$1.transform = transform;
|
|
2543
|
-
|
|
2544
|
-
var uniqAsync$1 = {};
|
|
2545
|
-
|
|
2546
|
-
uniqAsync$1.uniqAsync = void 0;
|
|
2547
|
-
async function* uniqAsync(iterable) {
|
|
2548
|
-
const bucket = new Set();
|
|
2549
|
-
for await (const element of iterable) {
|
|
2550
|
-
if (!bucket.has(element)) {
|
|
2551
|
-
yield element;
|
|
2552
|
-
bucket.add(element);
|
|
2553
|
-
}
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2556
|
-
uniqAsync$1.uniqAsync = uniqAsync;
|
|
2557
|
-
|
|
2558
|
-
var uniqByAsync$1 = {};
|
|
2559
|
-
|
|
2560
|
-
uniqByAsync$1.uniqByAsync = void 0;
|
|
2561
|
-
const types_1$9 = es2018$1;
|
|
2562
|
-
function uniqByAsync(iterable, fn) {
|
|
2563
|
-
if ((0, types_1$9.isAsyncIterable)(iterable)) {
|
|
2564
|
-
return uniqByAsyncIterable(iterable, fn);
|
|
2565
|
-
}
|
|
2566
|
-
else {
|
|
2567
|
-
return uniqByIterable(iterable, fn);
|
|
2568
|
-
}
|
|
2569
|
-
}
|
|
2570
|
-
uniqByAsync$1.uniqByAsync = uniqByAsync;
|
|
2571
|
-
async function* uniqByAsyncIterable(iterable, fn) {
|
|
2572
|
-
const bucket = new Set();
|
|
2573
|
-
let index = 0;
|
|
2574
|
-
for await (const element of iterable) {
|
|
2575
|
-
const result = await fn(element, index);
|
|
2576
|
-
if (!bucket.has(result)) {
|
|
2577
|
-
yield element;
|
|
2578
|
-
bucket.add(result);
|
|
2579
|
-
}
|
|
2580
|
-
index++;
|
|
2581
|
-
}
|
|
2582
|
-
}
|
|
2583
|
-
async function* uniqByIterable(iterable, fn) {
|
|
2584
|
-
const bucket = new Set();
|
|
2585
|
-
let index = 0;
|
|
2586
|
-
for (const element of iterable) {
|
|
2587
|
-
const result = await fn(element, index);
|
|
2588
|
-
if (!bucket.has(result)) {
|
|
2589
|
-
yield element;
|
|
2590
|
-
bucket.add(result);
|
|
2591
|
-
}
|
|
2592
|
-
index++;
|
|
2593
|
-
}
|
|
2594
|
-
}
|
|
2595
|
-
|
|
2596
|
-
var uniqBy$1 = {};
|
|
2597
|
-
|
|
2598
|
-
uniqBy$1.uniqBy = void 0;
|
|
2599
|
-
function* uniqBy(iterable, fn) {
|
|
2600
|
-
const bucket = new Set();
|
|
2601
|
-
let index = 0;
|
|
2602
|
-
for (const element of iterable) {
|
|
2603
|
-
const result = fn(element, index);
|
|
2604
|
-
if (!bucket.has(result)) {
|
|
2605
|
-
yield element;
|
|
2606
|
-
bucket.add(result);
|
|
2607
|
-
}
|
|
2608
|
-
index++;
|
|
2609
|
-
}
|
|
2610
|
-
}
|
|
2611
|
-
uniqBy$1.uniqBy = uniqBy;
|
|
2612
|
-
|
|
2613
|
-
var uniq$1 = {};
|
|
2614
|
-
|
|
2615
|
-
uniq$1.uniq = void 0;
|
|
2616
|
-
function* uniq(iterable) {
|
|
2617
|
-
const bucket = new Set();
|
|
2618
|
-
for (const element of iterable) {
|
|
2619
|
-
if (!bucket.has(element)) {
|
|
2620
|
-
yield element;
|
|
2621
|
-
bucket.add(element);
|
|
2622
|
-
}
|
|
2623
|
-
}
|
|
2624
|
-
}
|
|
2625
|
-
uniq$1.uniq = uniq;
|
|
2626
|
-
|
|
2627
|
-
var zipAsync$1 = {};
|
|
2628
|
-
|
|
2629
|
-
zipAsync$1.zipAsync = void 0;
|
|
2630
|
-
const types_1$8 = es2018$1;
|
|
2631
|
-
var Kind;
|
|
2632
|
-
(function (Kind) {
|
|
2633
|
-
Kind[Kind["Sync"] = 0] = "Sync";
|
|
2634
|
-
Kind[Kind["Async"] = 1] = "Async";
|
|
2635
|
-
})(Kind || (Kind = {}));
|
|
2636
|
-
function zipAsync(iterable, ...otherIterables) {
|
|
2637
|
-
return zipWithSize$1(iterable, ...otherIterables);
|
|
2638
|
-
}
|
|
2639
|
-
zipAsync$1.zipAsync = zipAsync;
|
|
2640
|
-
async function* zipWithSize$1(...iterables) {
|
|
2641
|
-
var _a, _b, _c, _d;
|
|
2642
|
-
const length = iterables.length;
|
|
2643
|
-
const iterators = iterables.map(iterable => {
|
|
2644
|
-
if ((0, types_1$8.isAsyncIterable)(iterable)) {
|
|
2645
|
-
return [Kind.Async, iterable[Symbol.asyncIterator]()];
|
|
2646
|
-
}
|
|
2647
|
-
else {
|
|
2648
|
-
return [Kind.Sync, iterable[Symbol.iterator]()];
|
|
2649
|
-
}
|
|
2650
|
-
});
|
|
2651
|
-
const dones = iterators.map(() => false);
|
|
2652
|
-
try {
|
|
2653
|
-
while (true) {
|
|
2654
|
-
const result = new Array(length);
|
|
2655
|
-
for (let i = 0; i < length; i++) {
|
|
2656
|
-
const [kind, iterator] = iterators[i];
|
|
2657
|
-
let temp;
|
|
2658
|
-
if (kind === Kind.Async) {
|
|
2659
|
-
temp = await iterator.next();
|
|
2660
|
-
}
|
|
2661
|
-
else {
|
|
2662
|
-
temp = iterator.next();
|
|
2663
|
-
}
|
|
2664
|
-
if (temp.done) {
|
|
2665
|
-
dones[i] = true;
|
|
2666
|
-
return;
|
|
2667
|
-
}
|
|
2668
|
-
result[i] = temp.value;
|
|
2669
|
-
}
|
|
2670
|
-
yield result;
|
|
2671
|
-
}
|
|
2672
|
-
}
|
|
2673
|
-
finally {
|
|
2674
|
-
const undoneIterators = iterators.filter((_, i) => !dones[i]);
|
|
2675
|
-
for (const [kind, iterator] of undoneIterators) {
|
|
2676
|
-
if (kind === Kind.Async) {
|
|
2677
|
-
await ((_b = (_a = iterator).return) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
2678
|
-
}
|
|
2679
|
-
else {
|
|
2680
|
-
(_d = (_c = iterator).return) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
2681
|
-
}
|
|
2682
|
-
}
|
|
2683
|
-
}
|
|
2684
|
-
}
|
|
2685
|
-
|
|
2686
|
-
var zip$1 = {};
|
|
2687
|
-
|
|
2688
|
-
zip$1.zip = void 0;
|
|
2689
|
-
function zip(iterable, ...otherIterables) {
|
|
2690
|
-
return zipWithSize(iterable, ...otherIterables);
|
|
2691
|
-
}
|
|
2692
|
-
zip$1.zip = zip;
|
|
2693
|
-
function* zipWithSize(...iterables) {
|
|
2694
|
-
const length = iterables.length;
|
|
2695
|
-
const iterators = iterables.map(iterable => iterable[Symbol.iterator]());
|
|
2696
|
-
const dones = iterators.map(() => false);
|
|
2697
|
-
try {
|
|
2698
|
-
while (true) {
|
|
2699
|
-
const result = new Array(length);
|
|
2700
|
-
for (let i = 0; i < length; i++) {
|
|
2701
|
-
const { value, done } = iterators[i].next();
|
|
2702
|
-
if (done) {
|
|
2703
|
-
dones[i] = true;
|
|
2704
|
-
return;
|
|
2705
|
-
}
|
|
2706
|
-
result[i] = value;
|
|
2707
|
-
}
|
|
2708
|
-
yield result;
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
finally {
|
|
2712
|
-
const undoneIterators = iterators.filter((_, i) => !dones[i]);
|
|
2713
|
-
undoneIterators.forEach(x => { var _a; return (_a = x.return) === null || _a === void 0 ? void 0 : _a.call(x); });
|
|
2714
|
-
}
|
|
2715
|
-
}
|
|
2716
|
-
|
|
2717
|
-
var hasRequiredMiddleware;
|
|
2718
|
-
|
|
2719
|
-
function requireMiddleware () {
|
|
2720
|
-
if (hasRequiredMiddleware) return middleware;
|
|
2721
|
-
hasRequiredMiddleware = 1;
|
|
2722
|
-
(function (exports) {
|
|
2723
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2724
|
-
if (k2 === undefined) k2 = k;
|
|
2725
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2726
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2727
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2728
|
-
}
|
|
2729
|
-
Object.defineProperty(o, k2, desc);
|
|
2730
|
-
}) : (function(o, m, k, k2) {
|
|
2731
|
-
if (k2 === undefined) k2 = k;
|
|
2732
|
-
o[k2] = m[k];
|
|
2733
|
-
}));
|
|
2734
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
2735
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
2736
|
-
};__exportStar(requireChunkAsync(), exports);
|
|
2737
|
-
__exportStar(chunkByAsync$1, exports);
|
|
2738
|
-
__exportStar(chunkBy$1, exports);
|
|
2739
|
-
__exportStar(requireChunk(), exports);
|
|
2740
|
-
__exportStar(concatAsync$1, exports);
|
|
2741
|
-
__exportStar(concat$1, exports);
|
|
2742
|
-
__exportStar(requireDropAsync(), exports);
|
|
2743
|
-
__exportStar(requireDropRightAsync(), exports);
|
|
2744
|
-
__exportStar(requireDropRight(), exports);
|
|
2745
|
-
__exportStar(dropUntilAsync$1, exports);
|
|
2746
|
-
__exportStar(dropUntil$1, exports);
|
|
2747
|
-
__exportStar(requireDrop(), exports);
|
|
2748
|
-
__exportStar(filterAsync$1, exports);
|
|
2749
|
-
__exportStar(filter$1, exports);
|
|
2750
|
-
__exportStar(requireFlattenAsync(), exports);
|
|
2751
|
-
__exportStar(flattenByAsync$1, exports);
|
|
2752
|
-
__exportStar(flattenBy$1, exports);
|
|
2753
|
-
__exportStar(requireFlattenDeepAsync(), exports);
|
|
2754
|
-
__exportStar(requireFlattenDeep(), exports);
|
|
2755
|
-
__exportStar(requireFlatten(), exports);
|
|
2756
|
-
__exportStar(mapAsync$1, exports);
|
|
2757
|
-
__exportStar(map$1, exports);
|
|
2758
|
-
__exportStar(requireRepeatAsync(), exports);
|
|
2759
|
-
__exportStar(requireRepeat(), exports);
|
|
2760
|
-
__exportStar(requireSliceAsync(), exports);
|
|
2761
|
-
__exportStar(requireSlice(), exports);
|
|
2762
|
-
__exportStar(splitAsync$1, exports);
|
|
2763
|
-
__exportStar(splitByAsync$1, exports);
|
|
2764
|
-
__exportStar(splitBy$1, exports);
|
|
2765
|
-
__exportStar(split$1, exports);
|
|
2766
|
-
__exportStar(requireTakeAsync(), exports);
|
|
2767
|
-
__exportStar(requireTakeRightAsync(), exports);
|
|
2768
|
-
__exportStar(requireTakeRight(), exports);
|
|
2769
|
-
__exportStar(takeUntilAsync$1, exports);
|
|
2770
|
-
__exportStar(takeUntil$1, exports);
|
|
2771
|
-
__exportStar(requireTake(), exports);
|
|
2772
|
-
__exportStar(tapAsync$1, exports);
|
|
2773
|
-
__exportStar(tap$1, exports);
|
|
2774
|
-
__exportStar(toAsyncIterable$1, exports);
|
|
2775
|
-
__exportStar(transformAsync$1, exports);
|
|
2776
|
-
__exportStar(transform$1, exports);
|
|
2777
|
-
__exportStar(uniqAsync$1, exports);
|
|
2778
|
-
__exportStar(uniqByAsync$1, exports);
|
|
2779
|
-
__exportStar(uniqBy$1, exports);
|
|
2780
|
-
__exportStar(uniq$1, exports);
|
|
2781
|
-
__exportStar(zipAsync$1, exports);
|
|
2782
|
-
__exportStar(zip$1, exports);
|
|
2783
|
-
|
|
2784
|
-
} (middleware));
|
|
2785
|
-
return middleware;
|
|
2786
|
-
}
|
|
2787
|
-
|
|
2788
|
-
var output = {};
|
|
2789
|
-
|
|
2790
|
-
var consume$1 = {};
|
|
2791
|
-
|
|
2792
|
-
consume$1.consume = void 0;
|
|
2793
|
-
function consume(iterable, consumer) {
|
|
2794
|
-
return consumer(iterable);
|
|
2795
|
-
}
|
|
2796
|
-
consume$1.consume = consume;
|
|
2797
|
-
|
|
2798
|
-
var eachAsync$1 = {};
|
|
2799
|
-
|
|
2800
|
-
eachAsync$1.eachAsync = void 0;
|
|
2801
|
-
const types_1$7 = es2018$1;
|
|
2802
|
-
function eachAsync(iterable, fn) {
|
|
2803
|
-
if ((0, types_1$7.isAsyncIterable)(iterable)) {
|
|
2804
|
-
return eachAsyncIterable(iterable, fn);
|
|
2805
|
-
}
|
|
2806
|
-
else {
|
|
2807
|
-
return eachIterable(iterable, fn);
|
|
2808
|
-
}
|
|
2809
|
-
}
|
|
2810
|
-
eachAsync$1.eachAsync = eachAsync;
|
|
2811
|
-
async function eachAsyncIterable(iterable, fn) {
|
|
2812
|
-
let index = 0;
|
|
2813
|
-
for await (const element of iterable) {
|
|
2814
|
-
await fn(element, index);
|
|
2815
|
-
index++;
|
|
2816
|
-
}
|
|
2817
|
-
}
|
|
2818
|
-
async function eachIterable(iterable, fn) {
|
|
2819
|
-
let index = 0;
|
|
2820
|
-
for (const element of iterable) {
|
|
2821
|
-
await fn(element, index);
|
|
2822
|
-
index++;
|
|
2823
|
-
}
|
|
2824
|
-
}
|
|
2825
|
-
|
|
2826
|
-
var each$1 = {};
|
|
2827
|
-
|
|
2828
|
-
each$1.each = void 0;
|
|
2829
|
-
function each(iterable, fn) {
|
|
2830
|
-
let index = 0;
|
|
2831
|
-
for (const element of iterable) {
|
|
2832
|
-
fn(element, index);
|
|
2833
|
-
index++;
|
|
2834
|
-
}
|
|
2835
|
-
}
|
|
2836
|
-
each$1.each = each;
|
|
2837
|
-
|
|
2838
|
-
var everyAsync$1 = {};
|
|
2839
|
-
|
|
2840
|
-
everyAsync$1.everyAsync = void 0;
|
|
2841
|
-
const types_1$6 = es2018$1;
|
|
2842
|
-
function everyAsync(iterable, predicate) {
|
|
2843
|
-
if ((0, types_1$6.isAsyncIterable)(iterable)) {
|
|
2844
|
-
return everyAsyncIterable(iterable, predicate);
|
|
2845
|
-
}
|
|
2846
|
-
else {
|
|
2847
|
-
return everyIterable(iterable, predicate);
|
|
2848
|
-
}
|
|
2849
|
-
}
|
|
2850
|
-
everyAsync$1.everyAsync = everyAsync;
|
|
2851
|
-
async function everyIterable(iterable, predicate) {
|
|
2852
|
-
let index = 0;
|
|
2853
|
-
for (const element of iterable) {
|
|
2854
|
-
if (!await predicate(element, index))
|
|
2855
|
-
return false;
|
|
2856
|
-
index++;
|
|
2857
|
-
}
|
|
2858
|
-
return true;
|
|
2859
|
-
}
|
|
2860
|
-
async function everyAsyncIterable(iterable, predicate) {
|
|
2861
|
-
let index = 0;
|
|
2862
|
-
for await (const element of iterable) {
|
|
2863
|
-
if (!await predicate(element, index))
|
|
2864
|
-
return false;
|
|
2865
|
-
index++;
|
|
2866
|
-
}
|
|
2867
|
-
return true;
|
|
2868
|
-
}
|
|
2869
|
-
|
|
2870
|
-
var every$1 = {};
|
|
2871
|
-
|
|
2872
|
-
every$1.every = void 0;
|
|
2873
|
-
function every(iterable, predicate) {
|
|
2874
|
-
let index = 0;
|
|
2875
|
-
for (const element of iterable) {
|
|
2876
|
-
if (!predicate(element, index))
|
|
2877
|
-
return false;
|
|
2878
|
-
index++;
|
|
2879
|
-
}
|
|
2880
|
-
return true;
|
|
2881
|
-
}
|
|
2882
|
-
every$1.every = every;
|
|
2883
|
-
|
|
2884
|
-
var findAsync$1 = {};
|
|
2885
|
-
|
|
2886
|
-
findAsync$1.findAsync = void 0;
|
|
2887
|
-
const types_1$5 = es2018$1;
|
|
2888
|
-
function findAsync(iterable, predicate) {
|
|
2889
|
-
if ((0, types_1$5.isAsyncIterable)(iterable)) {
|
|
2890
|
-
return findAsyncIterable(iterable, predicate);
|
|
2891
|
-
}
|
|
2892
|
-
else {
|
|
2893
|
-
return findIterable(iterable, predicate);
|
|
2894
|
-
}
|
|
2895
|
-
}
|
|
2896
|
-
findAsync$1.findAsync = findAsync;
|
|
2897
|
-
async function findIterable(iterable, predicate) {
|
|
2898
|
-
let index = 0;
|
|
2899
|
-
for (const element of iterable) {
|
|
2900
|
-
if (await predicate(element, index))
|
|
2901
|
-
return element;
|
|
2902
|
-
index++;
|
|
2903
|
-
}
|
|
2904
|
-
return undefined;
|
|
2905
|
-
}
|
|
2906
|
-
async function findAsyncIterable(iterable, predicate) {
|
|
2907
|
-
let index = 0;
|
|
2908
|
-
for await (const element of iterable) {
|
|
2909
|
-
if (await predicate(element, index))
|
|
2910
|
-
return element;
|
|
2911
|
-
index++;
|
|
2912
|
-
}
|
|
2913
|
-
return undefined;
|
|
2914
|
-
}
|
|
2915
|
-
|
|
2916
|
-
var find$1 = {};
|
|
2917
|
-
|
|
2918
|
-
find$1.find = void 0;
|
|
2919
|
-
function find(iterable, predicate) {
|
|
2920
|
-
let index = 0;
|
|
2921
|
-
for (const element of iterable) {
|
|
2922
|
-
if (predicate(element, index))
|
|
2923
|
-
return element;
|
|
2924
|
-
index++;
|
|
2925
|
-
}
|
|
2926
|
-
return undefined;
|
|
2927
|
-
}
|
|
2928
|
-
find$1.find = find;
|
|
2929
|
-
|
|
2930
|
-
var firstAsync$1 = {};
|
|
2931
|
-
|
|
2932
|
-
firstAsync$1.firstAsync = void 0;
|
|
2933
|
-
async function firstAsync(iterable) {
|
|
2934
|
-
for await (const element of iterable) {
|
|
2935
|
-
return element;
|
|
2936
|
-
}
|
|
2937
|
-
return undefined;
|
|
2938
|
-
}
|
|
2939
|
-
firstAsync$1.firstAsync = firstAsync;
|
|
2940
|
-
|
|
2941
|
-
var first$1 = {};
|
|
2942
|
-
|
|
2943
|
-
first$1.first = void 0;
|
|
2944
|
-
function first(iterable) {
|
|
2945
|
-
for (const element of iterable) {
|
|
2946
|
-
return element;
|
|
2947
|
-
}
|
|
2948
|
-
return undefined;
|
|
2949
|
-
}
|
|
2950
|
-
first$1.first = first;
|
|
2951
|
-
|
|
2952
|
-
var includesAsync$1 = {};
|
|
2953
|
-
|
|
2954
|
-
includesAsync$1.includesAsync = void 0;
|
|
2955
|
-
async function includesAsync(iterable, value) {
|
|
2956
|
-
for await (const element of iterable) {
|
|
2957
|
-
if (element === value)
|
|
2958
|
-
return true;
|
|
2959
|
-
}
|
|
2960
|
-
return false;
|
|
2961
|
-
}
|
|
2962
|
-
includesAsync$1.includesAsync = includesAsync;
|
|
2963
|
-
|
|
2964
|
-
var includes$1 = {};
|
|
2965
|
-
|
|
2966
|
-
includes$1.includes = void 0;
|
|
2967
|
-
function includes(iterable, value) {
|
|
2968
|
-
for (const element of iterable) {
|
|
2969
|
-
if (element === value)
|
|
2970
|
-
return true;
|
|
2971
|
-
}
|
|
2972
|
-
return false;
|
|
2973
|
-
}
|
|
2974
|
-
includes$1.includes = includes;
|
|
2975
|
-
|
|
2976
|
-
var matchAsync$1 = {};
|
|
2977
|
-
|
|
2978
|
-
matchAsync$1.matchAsync = void 0;
|
|
2979
|
-
async function matchAsync(iterable, sequence) {
|
|
2980
|
-
const sequenceLength = sequence.length;
|
|
2981
|
-
let matchCount = 0;
|
|
2982
|
-
for await (const element of iterable) {
|
|
2983
|
-
if (element === sequence[matchCount])
|
|
2984
|
-
matchCount++;
|
|
2985
|
-
if (matchCount === sequenceLength)
|
|
2986
|
-
return true;
|
|
2987
|
-
}
|
|
2988
|
-
return false;
|
|
2989
|
-
}
|
|
2990
|
-
matchAsync$1.matchAsync = matchAsync;
|
|
2991
|
-
|
|
2992
|
-
var match$1 = {};
|
|
2993
|
-
|
|
2994
|
-
match$1.match = void 0;
|
|
2995
|
-
function match(iterable, sequence) {
|
|
2996
|
-
const sequenceLength = sequence.length;
|
|
2997
|
-
let matchCount = 0;
|
|
2998
|
-
for (const element of iterable) {
|
|
2999
|
-
if (element === sequence[matchCount])
|
|
3000
|
-
matchCount++;
|
|
3001
|
-
if (matchCount === sequenceLength)
|
|
3002
|
-
return true;
|
|
3003
|
-
}
|
|
3004
|
-
return false;
|
|
3005
|
-
}
|
|
3006
|
-
match$1.match = match;
|
|
3007
|
-
|
|
3008
|
-
var reduceAsync$1 = {};
|
|
3009
|
-
|
|
3010
|
-
reduceAsync$1.reduceAsync = void 0;
|
|
3011
|
-
const types_1$4 = es2018$1;
|
|
3012
|
-
function reduceAsync(iterable, fn, initialValue) {
|
|
3013
|
-
if ((0, types_1$4.isUndefined)(initialValue)) {
|
|
3014
|
-
return reduceAsyncWithoutInitialValue(iterable, fn);
|
|
3015
|
-
}
|
|
3016
|
-
else {
|
|
3017
|
-
return reduceAsyncWithInitialValue(iterable, fn, initialValue);
|
|
3018
|
-
}
|
|
3019
|
-
}
|
|
3020
|
-
reduceAsync$1.reduceAsync = reduceAsync;
|
|
3021
|
-
function reduceAsyncWithInitialValue(iterable, fn, initialValue) {
|
|
3022
|
-
if ((0, types_1$4.isAsyncIterable)(iterable)) {
|
|
3023
|
-
return reduceAsyncIterable(iterable);
|
|
3024
|
-
}
|
|
3025
|
-
else {
|
|
3026
|
-
return reduceIterable(iterable);
|
|
3027
|
-
}
|
|
3028
|
-
async function reduceIterable(iterable) {
|
|
3029
|
-
let result = initialValue, index = 0;
|
|
3030
|
-
for (const currentValue of iterable) {
|
|
3031
|
-
result = await fn(result, currentValue, index++);
|
|
3032
|
-
}
|
|
3033
|
-
return result;
|
|
3034
|
-
}
|
|
3035
|
-
async function reduceAsyncIterable(iterable) {
|
|
3036
|
-
let result = initialValue, index = 0;
|
|
3037
|
-
for await (const currentValue of iterable) {
|
|
3038
|
-
result = await fn(result, currentValue, index++);
|
|
3039
|
-
}
|
|
3040
|
-
return result;
|
|
3041
|
-
}
|
|
3042
|
-
}
|
|
3043
|
-
function reduceAsyncWithoutInitialValue(iterable, fn) {
|
|
3044
|
-
if ((0, types_1$4.isAsyncIterable)(iterable)) {
|
|
3045
|
-
return reduceAsyncIterable(iterable);
|
|
3046
|
-
}
|
|
3047
|
-
else {
|
|
3048
|
-
return reduceIterable(iterable);
|
|
3049
|
-
}
|
|
3050
|
-
async function reduceAsyncIterable(iterable) {
|
|
3051
|
-
var _a;
|
|
3052
|
-
const iterator = iterable[Symbol.asyncIterator]();
|
|
3053
|
-
let done;
|
|
3054
|
-
try {
|
|
3055
|
-
let result = await readInitialValue(iterator);
|
|
3056
|
-
let index = 1;
|
|
3057
|
-
let value;
|
|
3058
|
-
while ({ value, done } = await iterator.next(), !done) {
|
|
3059
|
-
result = await fn(result, value, index++);
|
|
3060
|
-
}
|
|
3061
|
-
return result;
|
|
3062
|
-
}
|
|
3063
|
-
finally {
|
|
3064
|
-
if (!done)
|
|
3065
|
-
await ((_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator));
|
|
3066
|
-
}
|
|
3067
|
-
async function readInitialValue(iterator) {
|
|
3068
|
-
const result = await iterator.next();
|
|
3069
|
-
if (result.done) {
|
|
3070
|
-
done = true;
|
|
3071
|
-
throw new Error('Reduce of empty iterable with no initial value');
|
|
3072
|
-
}
|
|
3073
|
-
return result.value;
|
|
3074
|
-
}
|
|
3075
|
-
}
|
|
3076
|
-
async function reduceIterable(iterable) {
|
|
3077
|
-
var _a;
|
|
3078
|
-
const iterator = iterable[Symbol.iterator]();
|
|
3079
|
-
let done;
|
|
3080
|
-
try {
|
|
3081
|
-
let result = readInitialValue(iterator);
|
|
3082
|
-
let index = 1;
|
|
3083
|
-
let value;
|
|
3084
|
-
while ({ value, done } = iterator.next(), !done) {
|
|
3085
|
-
result = await fn(result, value, index++);
|
|
3086
|
-
}
|
|
3087
|
-
return result;
|
|
3088
|
-
}
|
|
3089
|
-
finally {
|
|
3090
|
-
if (!done)
|
|
3091
|
-
(_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
|
|
3092
|
-
}
|
|
3093
|
-
function readInitialValue(iterator) {
|
|
3094
|
-
const result = iterator.next();
|
|
3095
|
-
if (result.done) {
|
|
3096
|
-
done = true;
|
|
3097
|
-
throw new Error('Reduce of empty iterable with no initial value');
|
|
3098
|
-
}
|
|
3099
|
-
return result.value;
|
|
3100
|
-
}
|
|
3101
|
-
}
|
|
3102
|
-
}
|
|
3103
|
-
|
|
3104
|
-
var reduce$1 = {};
|
|
3105
|
-
|
|
3106
|
-
reduce$1.reduce = void 0;
|
|
3107
|
-
const types_1$3 = es2018$1;
|
|
3108
|
-
function reduce(iterable, fn, initialValue) {
|
|
3109
|
-
if ((0, types_1$3.isUndefined)(initialValue)) {
|
|
3110
|
-
return reduceWithoutInitialValue(iterable, fn);
|
|
3111
|
-
}
|
|
3112
|
-
else {
|
|
3113
|
-
return reduceWithInitialValue(iterable, fn, initialValue);
|
|
3114
|
-
}
|
|
3115
|
-
}
|
|
3116
|
-
reduce$1.reduce = reduce;
|
|
3117
|
-
function reduceWithInitialValue(iterable, fn, initialValue) {
|
|
3118
|
-
let result = initialValue, index = 0;
|
|
3119
|
-
for (const currentValue of iterable) {
|
|
3120
|
-
result = fn(result, currentValue, index++);
|
|
3121
|
-
}
|
|
3122
|
-
return result;
|
|
3123
|
-
}
|
|
3124
|
-
function reduceWithoutInitialValue(iterable, fn) {
|
|
3125
|
-
var _a;
|
|
3126
|
-
const iterator = iterable[Symbol.iterator]();
|
|
3127
|
-
let done;
|
|
3128
|
-
try {
|
|
3129
|
-
let result = readInitialValue(iterator);
|
|
3130
|
-
let index = 1;
|
|
3131
|
-
let value;
|
|
3132
|
-
while ({ value, done } = iterator.next(), !done) {
|
|
3133
|
-
result = fn(result, value, index++);
|
|
3134
|
-
}
|
|
3135
|
-
return result;
|
|
3136
|
-
}
|
|
3137
|
-
finally {
|
|
3138
|
-
if (!done)
|
|
3139
|
-
(_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
|
|
3140
|
-
}
|
|
3141
|
-
function readInitialValue(iterator) {
|
|
3142
|
-
const result = iterator.next();
|
|
3143
|
-
if (result.done) {
|
|
3144
|
-
done = true;
|
|
3145
|
-
throw new Error('Reduce of empty iterable with no initial value');
|
|
3146
|
-
}
|
|
3147
|
-
return result.value;
|
|
3148
|
-
}
|
|
3149
|
-
}
|
|
3150
|
-
|
|
3151
|
-
var someAsync$1 = {};
|
|
3152
|
-
|
|
3153
|
-
someAsync$1.someAsync = void 0;
|
|
3154
|
-
const types_1$2 = es2018$1;
|
|
3155
|
-
function someAsync(iterable, predicate) {
|
|
3156
|
-
if ((0, types_1$2.isAsyncIterable)(iterable)) {
|
|
3157
|
-
return someAsyncIterable(iterable, predicate);
|
|
3158
|
-
}
|
|
3159
|
-
else {
|
|
3160
|
-
return someIterable(iterable, predicate);
|
|
3161
|
-
}
|
|
3162
|
-
}
|
|
3163
|
-
someAsync$1.someAsync = someAsync;
|
|
3164
|
-
async function someIterable(iterable, predicate) {
|
|
3165
|
-
let index = 0;
|
|
3166
|
-
for (const element of iterable) {
|
|
3167
|
-
if (await predicate(element, index))
|
|
3168
|
-
return true;
|
|
3169
|
-
index++;
|
|
3170
|
-
}
|
|
3171
|
-
return false;
|
|
3172
|
-
}
|
|
3173
|
-
async function someAsyncIterable(iterable, predicate) {
|
|
3174
|
-
let index = 0;
|
|
3175
|
-
for await (const element of iterable) {
|
|
3176
|
-
if (await predicate(element, index))
|
|
3177
|
-
return true;
|
|
3178
|
-
index++;
|
|
3179
|
-
}
|
|
3180
|
-
return false;
|
|
3181
|
-
}
|
|
3182
|
-
|
|
3183
|
-
var some$1 = {};
|
|
3184
|
-
|
|
3185
|
-
some$1.some = void 0;
|
|
3186
|
-
function some(iterable, predicate) {
|
|
3187
|
-
let index = 0;
|
|
3188
|
-
for (const element of iterable) {
|
|
3189
|
-
if (predicate(element, index))
|
|
3190
|
-
return true;
|
|
3191
|
-
index++;
|
|
3192
|
-
}
|
|
3193
|
-
return false;
|
|
3194
|
-
}
|
|
3195
|
-
some$1.some = some;
|
|
3196
|
-
|
|
3197
|
-
var lastAsync$1 = {};
|
|
3198
|
-
|
|
3199
|
-
lastAsync$1.lastAsync = void 0;
|
|
3200
|
-
async function lastAsync(iterable) {
|
|
3201
|
-
var _a;
|
|
3202
|
-
const iterator = iterable[Symbol.asyncIterator]();
|
|
3203
|
-
let done;
|
|
3204
|
-
try {
|
|
3205
|
-
let value;
|
|
3206
|
-
let result;
|
|
3207
|
-
while ({ value, done } = await iterator.next(), !done) {
|
|
3208
|
-
result = value;
|
|
3209
|
-
}
|
|
3210
|
-
return result;
|
|
3211
|
-
}
|
|
3212
|
-
finally {
|
|
3213
|
-
if (!done)
|
|
3214
|
-
await ((_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator));
|
|
3215
|
-
}
|
|
3216
|
-
}
|
|
3217
|
-
lastAsync$1.lastAsync = lastAsync;
|
|
3218
|
-
|
|
3219
|
-
var last$1 = {};
|
|
3220
|
-
|
|
3221
|
-
last$1.last = void 0;
|
|
3222
|
-
function last(iterable) {
|
|
3223
|
-
var _a;
|
|
3224
|
-
const iterator = iterable[Symbol.iterator]();
|
|
3225
|
-
let done;
|
|
3226
|
-
try {
|
|
3227
|
-
let value;
|
|
3228
|
-
let result;
|
|
3229
|
-
while ({ value, done } = iterator.next(), !done) {
|
|
3230
|
-
result = value;
|
|
3231
|
-
}
|
|
3232
|
-
return result;
|
|
3233
|
-
}
|
|
3234
|
-
finally {
|
|
3235
|
-
if (!done)
|
|
3236
|
-
(_a = iterator.return) === null || _a === void 0 ? void 0 : _a.call(iterator);
|
|
3237
|
-
}
|
|
3238
|
-
}
|
|
3239
|
-
last$1.last = last;
|
|
3240
|
-
|
|
3241
|
-
var toArrayAsync$1 = {};
|
|
3242
|
-
|
|
3243
|
-
toArrayAsync$1.toArrayAsync = void 0;
|
|
3244
|
-
const consume_1$3 = consume$1;
|
|
3245
|
-
function toArrayAsync(iterable) {
|
|
3246
|
-
return (0, consume_1$3.consume)(iterable, async (iterable) => {
|
|
3247
|
-
const result = [];
|
|
3248
|
-
for await (const element of iterable) {
|
|
3249
|
-
result.push(element);
|
|
3250
|
-
}
|
|
3251
|
-
return result;
|
|
3252
|
-
});
|
|
3253
|
-
}
|
|
3254
|
-
toArrayAsync$1.toArrayAsync = toArrayAsync;
|
|
3255
|
-
|
|
3256
|
-
var toArray$1 = {};
|
|
3257
|
-
|
|
3258
|
-
toArray$1.toArray = void 0;
|
|
3259
|
-
const consume_1$2 = consume$1;
|
|
3260
|
-
function toArray(iterable) {
|
|
3261
|
-
return (0, consume_1$2.consume)(iterable, iterable => Array.from(iterable));
|
|
3262
|
-
}
|
|
3263
|
-
toArray$1.toArray = toArray;
|
|
3264
|
-
|
|
3265
|
-
var toSetAsync$1 = {};
|
|
3266
|
-
|
|
3267
|
-
toSetAsync$1.toSetAsync = void 0;
|
|
3268
|
-
const consume_1$1 = consume$1;
|
|
3269
|
-
function toSetAsync(iterable) {
|
|
3270
|
-
return (0, consume_1$1.consume)(iterable, async (iterable) => {
|
|
3271
|
-
const result = new Set();
|
|
3272
|
-
for await (const element of iterable) {
|
|
3273
|
-
result.add(element);
|
|
3274
|
-
}
|
|
3275
|
-
return result;
|
|
3276
|
-
});
|
|
3277
|
-
}
|
|
3278
|
-
toSetAsync$1.toSetAsync = toSetAsync;
|
|
3279
|
-
|
|
3280
|
-
var toSet$1 = {};
|
|
3281
|
-
|
|
3282
|
-
toSet$1.toSet = void 0;
|
|
3283
|
-
const consume_1 = consume$1;
|
|
3284
|
-
function toSet(iterable) {
|
|
3285
|
-
return (0, consume_1.consume)(iterable, iterable => new Set(iterable));
|
|
3286
|
-
}
|
|
3287
|
-
toSet$1.toSet = toSet;
|
|
3288
|
-
|
|
3289
|
-
var count$1 = {};
|
|
3290
|
-
|
|
3291
|
-
count$1.count = void 0;
|
|
3292
|
-
function count(iterable) {
|
|
3293
|
-
let count = 0;
|
|
3294
|
-
for (const _ of iterable) {
|
|
3295
|
-
count++;
|
|
3296
|
-
}
|
|
3297
|
-
return count;
|
|
3298
|
-
}
|
|
3299
|
-
count$1.count = count;
|
|
3300
|
-
|
|
3301
|
-
var countAsync$1 = {};
|
|
3302
|
-
|
|
3303
|
-
countAsync$1.countAsync = void 0;
|
|
3304
|
-
async function countAsync(iterable) {
|
|
3305
|
-
let count = 0;
|
|
3306
|
-
for await (const _ of iterable) {
|
|
3307
|
-
count++;
|
|
3308
|
-
}
|
|
3309
|
-
return count;
|
|
3310
|
-
}
|
|
3311
|
-
countAsync$1.countAsync = countAsync;
|
|
3312
|
-
|
|
3313
|
-
var groupBy$1 = {};
|
|
3314
|
-
|
|
3315
|
-
groupBy$1.groupBy = void 0;
|
|
3316
|
-
const each_1 = each$1;
|
|
3317
|
-
function groupBy(iterable, fn) {
|
|
3318
|
-
const map = new Map();
|
|
3319
|
-
(0, each_1.each)(iterable, (element, index) => {
|
|
3320
|
-
const group = fn(element, index);
|
|
3321
|
-
if (!map.has(group)) {
|
|
3322
|
-
map.set(group, []);
|
|
3323
|
-
}
|
|
3324
|
-
map.get(group).push(element);
|
|
3325
|
-
});
|
|
3326
|
-
return map;
|
|
3327
|
-
}
|
|
3328
|
-
groupBy$1.groupBy = groupBy;
|
|
3329
|
-
|
|
3330
|
-
var groupByAsync$1 = {};
|
|
3331
|
-
|
|
3332
|
-
groupByAsync$1.groupByAsync = void 0;
|
|
3333
|
-
const each_async_1 = eachAsync$1;
|
|
3334
|
-
async function groupByAsync(iterable, fn) {
|
|
3335
|
-
const map = new Map();
|
|
3336
|
-
await (0, each_async_1.eachAsync)(iterable, async (element, index) => {
|
|
3337
|
-
const group = await fn(element, index);
|
|
3338
|
-
if (!map.has(group)) {
|
|
3339
|
-
map.set(group, []);
|
|
3340
|
-
}
|
|
3341
|
-
map.get(group).push(element);
|
|
3342
|
-
});
|
|
3343
|
-
return map;
|
|
3344
|
-
}
|
|
3345
|
-
groupByAsync$1.groupByAsync = groupByAsync;
|
|
3346
|
-
|
|
3347
|
-
(function (exports) {
|
|
3348
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3349
|
-
if (k2 === undefined) k2 = k;
|
|
3350
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3351
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3352
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
3353
|
-
}
|
|
3354
|
-
Object.defineProperty(o, k2, desc);
|
|
3355
|
-
}) : (function(o, m, k, k2) {
|
|
3356
|
-
if (k2 === undefined) k2 = k;
|
|
3357
|
-
o[k2] = m[k];
|
|
3358
|
-
}));
|
|
3359
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
3360
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3361
|
-
};__exportStar(consume$1, exports);
|
|
3362
|
-
__exportStar(eachAsync$1, exports);
|
|
3363
|
-
__exportStar(each$1, exports);
|
|
3364
|
-
__exportStar(everyAsync$1, exports);
|
|
3365
|
-
__exportStar(every$1, exports);
|
|
3366
|
-
__exportStar(findAsync$1, exports);
|
|
3367
|
-
__exportStar(find$1, exports);
|
|
3368
|
-
__exportStar(firstAsync$1, exports);
|
|
3369
|
-
__exportStar(first$1, exports);
|
|
3370
|
-
__exportStar(includesAsync$1, exports);
|
|
3371
|
-
__exportStar(includes$1, exports);
|
|
3372
|
-
__exportStar(matchAsync$1, exports);
|
|
3373
|
-
__exportStar(match$1, exports);
|
|
3374
|
-
__exportStar(reduceAsync$1, exports);
|
|
3375
|
-
__exportStar(reduce$1, exports);
|
|
3376
|
-
__exportStar(someAsync$1, exports);
|
|
3377
|
-
__exportStar(some$1, exports);
|
|
3378
|
-
__exportStar(lastAsync$1, exports);
|
|
3379
|
-
__exportStar(last$1, exports);
|
|
3380
|
-
__exportStar(toArrayAsync$1, exports);
|
|
3381
|
-
__exportStar(toArray$1, exports);
|
|
3382
|
-
__exportStar(toSetAsync$1, exports);
|
|
3383
|
-
__exportStar(toSet$1, exports);
|
|
3384
|
-
__exportStar(count$1, exports);
|
|
3385
|
-
__exportStar(countAsync$1, exports);
|
|
3386
|
-
__exportStar(groupBy$1, exports);
|
|
3387
|
-
__exportStar(groupByAsync$1, exports);
|
|
3388
|
-
|
|
3389
|
-
} (output));
|
|
3390
|
-
|
|
3391
|
-
var hasRequiredEs2018$1;
|
|
3392
|
-
|
|
3393
|
-
function requireEs2018$1 () {
|
|
3394
|
-
if (hasRequiredEs2018$1) return es2018$2;
|
|
3395
|
-
hasRequiredEs2018$1 = 1;
|
|
3396
|
-
(function (exports) {
|
|
3397
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3398
|
-
if (k2 === undefined) k2 = k;
|
|
3399
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3400
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3401
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
3402
|
-
}
|
|
3403
|
-
Object.defineProperty(o, k2, desc);
|
|
3404
|
-
}) : (function(o, m, k, k2) {
|
|
3405
|
-
if (k2 === undefined) k2 = k;
|
|
3406
|
-
o[k2] = m[k];
|
|
3407
|
-
}));
|
|
3408
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
3409
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3410
|
-
};__exportStar(requireMiddleware(), exports);
|
|
3411
|
-
__exportStar(output, exports);
|
|
3412
|
-
|
|
3413
|
-
} (es2018$2));
|
|
3414
|
-
return es2018$2;
|
|
3415
|
-
}
|
|
3416
|
-
|
|
3417
|
-
var getErrorNames$1 = {};
|
|
3418
|
-
|
|
3419
|
-
var traverseErrorPrototypeChain$1 = {};
|
|
3420
|
-
|
|
3421
|
-
traverseErrorPrototypeChain$1.traverseErrorPrototypeChain = void 0;
|
|
3422
|
-
function* traverseErrorPrototypeChain(err) {
|
|
3423
|
-
let current = err;
|
|
3424
|
-
while ((current = Object.getPrototypeOf(current))) {
|
|
3425
|
-
yield current;
|
|
3426
|
-
if (current === Error.prototype)
|
|
3427
|
-
break;
|
|
3428
|
-
}
|
|
3429
|
-
}
|
|
3430
|
-
traverseErrorPrototypeChain$1.traverseErrorPrototypeChain = traverseErrorPrototypeChain;
|
|
3431
|
-
|
|
3432
|
-
getErrorNames$1.getErrorNames = void 0;
|
|
3433
|
-
const types_1$1 = es2018$7;
|
|
3434
|
-
const traverse_error_prototype_chain_1 = traverseErrorPrototypeChain$1;
|
|
3435
|
-
function* getErrorNames(err) {
|
|
3436
|
-
var _a;
|
|
3437
|
-
if ((0, types_1$1.isError)(err)) {
|
|
3438
|
-
for (const prototype of (0, traverse_error_prototype_chain_1.traverseErrorPrototypeChain)(err)) {
|
|
3439
|
-
if ((_a = prototype.constructor) === null || _a === void 0 ? void 0 : _a.name) {
|
|
3440
|
-
yield prototype.constructor.name;
|
|
3441
|
-
}
|
|
3442
|
-
}
|
|
3443
|
-
}
|
|
3444
|
-
else {
|
|
3445
|
-
yield err.name;
|
|
3446
|
-
yield* err.ancestors;
|
|
3447
|
-
}
|
|
3448
|
-
}
|
|
3449
|
-
getErrorNames$1.getErrorNames = getErrorNames;
|
|
3450
|
-
|
|
3451
|
-
var serializableError = {};
|
|
3452
|
-
|
|
3453
|
-
serializableError.isSerializableError = void 0;
|
|
3454
|
-
const types_1 = es2018$7;
|
|
3455
|
-
function isSerializableError(val) {
|
|
3456
|
-
return (0, types_1.isObject)(val)
|
|
3457
|
-
&& (0, types_1.isString)(val.name)
|
|
3458
|
-
&& (0, types_1.isString)(val.message)
|
|
3459
|
-
&& ((0, types_1.isString)(val.stack) || (0, types_1.isNull)(val.stack))
|
|
3460
|
-
&& ((0, types_1.isArray)(val.ancestors) && val.ancestors.every(types_1.isString));
|
|
3461
|
-
}
|
|
3462
|
-
serializableError.isSerializableError = isSerializableError;
|
|
3463
|
-
|
|
3464
|
-
var hasRequiredCustomError;
|
|
3465
|
-
|
|
3466
|
-
function requireCustomError () {
|
|
3467
|
-
if (hasRequiredCustomError) return customError;
|
|
3468
|
-
hasRequiredCustomError = 1;
|
|
3469
|
-
customError.CustomError = void 0;
|
|
3470
|
-
const iterable_operator_1 = requireEs2018$1();
|
|
3471
|
-
const get_error_names_1 = getErrorNames$1;
|
|
3472
|
-
const types_1 = es2018$7;
|
|
3473
|
-
const serializable_error_1 = serializableError;
|
|
3474
|
-
class CustomError extends Error {
|
|
3475
|
-
get name() {
|
|
3476
|
-
var _a, _b;
|
|
3477
|
-
return (_b = (_a = (0, iterable_operator_1.first)((0, get_error_names_1.getErrorNames)(this))) !== null && _a !== void 0 ? _a : CustomError.name) !== null && _b !== void 0 ? _b : 'CustomError';
|
|
3478
|
-
}
|
|
3479
|
-
static [Symbol.hasInstance](instance) {
|
|
3480
|
-
var _a;
|
|
3481
|
-
if ((0, types_1.isError)(instance) || (0, serializable_error_1.isSerializableError)(instance)) {
|
|
3482
|
-
const reversedClassNames = [
|
|
3483
|
-
(_a = this.prototype.constructor.name) !== null && _a !== void 0 ? _a : this.name,
|
|
3484
|
-
...(0, get_error_names_1.getErrorNames)(this.prototype)
|
|
3485
|
-
].reverse();
|
|
3486
|
-
const reversedInstanceNames = (0, iterable_operator_1.toArray)((0, get_error_names_1.getErrorNames)(instance)).reverse();
|
|
3487
|
-
return reversedClassNames.every((x, i) => x === reversedInstanceNames[i]);
|
|
3488
|
-
}
|
|
3489
|
-
else {
|
|
3490
|
-
return false;
|
|
3491
|
-
}
|
|
3492
|
-
}
|
|
3493
|
-
}
|
|
3494
|
-
customError.CustomError = CustomError;
|
|
3495
|
-
|
|
3496
|
-
return customError;
|
|
3497
|
-
}
|
|
3498
|
-
|
|
3499
|
-
var assertionError = {};
|
|
3500
|
-
|
|
3501
|
-
var hasRequiredAssertionError;
|
|
3502
|
-
|
|
3503
|
-
function requireAssertionError () {
|
|
3504
|
-
if (hasRequiredAssertionError) return assertionError;
|
|
3505
|
-
hasRequiredAssertionError = 1;
|
|
3506
|
-
assertionError.AssertionError = void 0;
|
|
3507
|
-
const custom_error_1 = requireCustomError();
|
|
3508
|
-
class AssertionError extends custom_error_1.CustomError {
|
|
3509
|
-
}
|
|
3510
|
-
assertionError.AssertionError = AssertionError;
|
|
3511
|
-
|
|
3512
|
-
return assertionError;
|
|
3513
|
-
}
|
|
3514
|
-
|
|
3515
|
-
var normalize = {};
|
|
3516
|
-
|
|
3517
|
-
var hasRequiredNormalize;
|
|
3518
|
-
|
|
3519
|
-
function requireNormalize () {
|
|
3520
|
-
if (hasRequiredNormalize) return normalize;
|
|
3521
|
-
hasRequiredNormalize = 1;
|
|
3522
|
-
normalize.normalize = void 0;
|
|
3523
|
-
const get_error_names_1 = getErrorNames$1;
|
|
3524
|
-
const iterable_operator_1 = requireEs2018$1();
|
|
3525
|
-
function normalize$1(err) {
|
|
3526
|
-
var _a;
|
|
3527
|
-
const [name, ...ancestors] = (0, iterable_operator_1.toArray)((0, get_error_names_1.getErrorNames)(err));
|
|
3528
|
-
return {
|
|
3529
|
-
name,
|
|
3530
|
-
ancestors,
|
|
3531
|
-
message: err.message,
|
|
3532
|
-
stack: (_a = err.stack) !== null && _a !== void 0 ? _a : null
|
|
3533
|
-
};
|
|
3534
|
-
}
|
|
3535
|
-
normalize.normalize = normalize$1;
|
|
3536
|
-
|
|
3537
|
-
return normalize;
|
|
3538
|
-
}
|
|
3539
|
-
|
|
3540
|
-
var hydrate$1 = {};
|
|
3541
|
-
|
|
3542
|
-
var es2018 = {};
|
|
3543
|
-
|
|
3544
|
-
var pass$1 = {};
|
|
3545
|
-
|
|
3546
|
-
pass$1.pass = void 0;
|
|
3547
|
-
function pass() { }
|
|
3548
|
-
pass$1.pass = pass;
|
|
3549
|
-
|
|
3550
|
-
var passAsync$1 = {};
|
|
3551
|
-
|
|
3552
|
-
passAsync$1.passAsync = void 0;
|
|
3553
|
-
async function passAsync() { }
|
|
3554
|
-
passAsync$1.passAsync = passAsync;
|
|
3555
|
-
|
|
3556
|
-
(function (exports) {
|
|
3557
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3558
|
-
if (k2 === undefined) k2 = k;
|
|
3559
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
3560
|
-
}) : (function(o, m, k, k2) {
|
|
3561
|
-
if (k2 === undefined) k2 = k;
|
|
3562
|
-
o[k2] = m[k];
|
|
3563
|
-
}));
|
|
3564
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
3565
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3566
|
-
};__exportStar(pass$1, exports);
|
|
3567
|
-
__exportStar(passAsync$1, exports);
|
|
3568
|
-
|
|
3569
|
-
} (es2018));
|
|
3570
|
-
|
|
3571
|
-
hydrate$1.hydrate = void 0;
|
|
3572
|
-
const pass_1 = es2018;
|
|
3573
|
-
function hydrate(err) {
|
|
3574
|
-
var _a;
|
|
3575
|
-
const errorNames = [err.name, ...err.ancestors]
|
|
3576
|
-
.slice(0, -1)
|
|
3577
|
-
.reverse();
|
|
3578
|
-
let errorConstructor = Error;
|
|
3579
|
-
for (const name of errorNames) {
|
|
3580
|
-
errorConstructor = createChildErrorConstructor(errorConstructor, name);
|
|
3581
|
-
}
|
|
3582
|
-
const result = new errorConstructor();
|
|
3583
|
-
result.name = err.name;
|
|
3584
|
-
result.message = err.message;
|
|
3585
|
-
result.stack = (_a = err.stack) !== null && _a !== void 0 ? _a : undefined;
|
|
3586
|
-
return result;
|
|
3587
|
-
}
|
|
3588
|
-
hydrate$1.hydrate = hydrate;
|
|
3589
|
-
function createChildErrorConstructor(parentErrorConstructor, name) {
|
|
3590
|
-
const constructor = function () { (0, pass_1.pass)(); };
|
|
3591
|
-
constructor.prototype = Object.create(parentErrorConstructor.prototype);
|
|
3592
|
-
constructor.prototype.constructor = constructor;
|
|
3593
|
-
Object.defineProperty(constructor, 'name', { value: name });
|
|
3594
|
-
return constructor;
|
|
3595
|
-
}
|
|
3596
|
-
|
|
3597
|
-
var assert = {};
|
|
3598
|
-
|
|
3599
|
-
var hasRequiredAssert;
|
|
3600
|
-
|
|
3601
|
-
function requireAssert () {
|
|
3602
|
-
if (hasRequiredAssert) return assert;
|
|
3603
|
-
hasRequiredAssert = 1;
|
|
3604
|
-
assert.assert = void 0;
|
|
3605
|
-
const assertion_error_1 = requireAssertionError();
|
|
3606
|
-
function assert$1(condition, message) {
|
|
3607
|
-
if (!condition)
|
|
3608
|
-
throw new assertion_error_1.AssertionError(message);
|
|
3609
|
-
}
|
|
3610
|
-
assert.assert = assert$1;
|
|
3611
|
-
|
|
3612
|
-
return assert;
|
|
3613
|
-
}
|
|
3614
|
-
|
|
3615
|
-
var hasRequiredEs2018;
|
|
3616
|
-
|
|
3617
|
-
function requireEs2018 () {
|
|
3618
|
-
if (hasRequiredEs2018) return es2018$3;
|
|
3619
|
-
hasRequiredEs2018 = 1;
|
|
3620
|
-
(function (exports) {
|
|
3621
|
-
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3622
|
-
if (k2 === undefined) k2 = k;
|
|
3623
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3624
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3625
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
3626
|
-
}
|
|
3627
|
-
Object.defineProperty(o, k2, desc);
|
|
3628
|
-
}) : (function(o, m, k, k2) {
|
|
3629
|
-
if (k2 === undefined) k2 = k;
|
|
3630
|
-
o[k2] = m[k];
|
|
3631
|
-
}));
|
|
3632
|
-
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
3633
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3634
|
-
};__exportStar(requireCustomError(), exports);
|
|
3635
|
-
__exportStar(requireAssertionError(), exports);
|
|
3636
|
-
__exportStar(serializableError, exports);
|
|
3637
|
-
__exportStar(requireNormalize(), exports);
|
|
3638
|
-
__exportStar(hydrate$1, exports);
|
|
3639
|
-
__exportStar(requireAssert(), exports);
|
|
3640
|
-
__exportStar(getErrorNames$1, exports);
|
|
3641
|
-
__exportStar(traverseErrorPrototypeChain$1, exports);
|
|
3642
|
-
|
|
3643
|
-
} (es2018$3));
|
|
3644
|
-
return es2018$3;
|
|
3645
|
-
}
|
|
3646
|
-
|
|
3647
|
-
var es2018Exports$1 = requireEs2018();
|
|
3648
|
-
|
|
3649
|
-
var es2018Exports = requireEs2018$1();
|
|
3650
|
-
|
|
3651
|
-
class LRUMap {
|
|
3652
|
-
constructor(limit) {
|
|
3653
|
-
this.map = new Map();
|
|
3654
|
-
es2018Exports$1.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
|
|
3655
|
-
es2018Exports$1.assert(limit > 0, 'The parameter limit must be a positive value');
|
|
3656
|
-
this.limit = limit;
|
|
3657
|
-
}
|
|
3658
|
-
get [Symbol.toStringTag]() {
|
|
3659
|
-
return this.constructor.name;
|
|
3660
|
-
}
|
|
3661
|
-
get size() {
|
|
3662
|
-
return this.map.size;
|
|
3663
|
-
}
|
|
3664
|
-
set(key, value) {
|
|
3665
|
-
if (this.map.has(key)) {
|
|
3666
|
-
this.updateItem(key, value);
|
|
3667
|
-
}
|
|
3668
|
-
else {
|
|
3669
|
-
if (this.map.size === this.limit) {
|
|
3670
|
-
this.map.delete(this.getColdestKey());
|
|
3671
|
-
}
|
|
3672
|
-
this.map.set(key, value);
|
|
3673
|
-
}
|
|
3674
|
-
return this;
|
|
3675
|
-
}
|
|
3676
|
-
has(key) {
|
|
3677
|
-
return this.map.has(key);
|
|
3678
|
-
}
|
|
3679
|
-
get(key) {
|
|
3680
|
-
if (!this.has(key))
|
|
3681
|
-
return undefined;
|
|
3682
|
-
const value = this.map.get(key);
|
|
3683
|
-
this.updateItem(key, value);
|
|
3684
|
-
return value;
|
|
3685
|
-
}
|
|
3686
|
-
delete(key) {
|
|
3687
|
-
return this.map.delete(key);
|
|
3688
|
-
}
|
|
3689
|
-
clear() {
|
|
3690
|
-
this.map.clear();
|
|
3691
|
-
}
|
|
3692
|
-
/**
|
|
3693
|
-
* Reinsert the item.
|
|
3694
|
-
*/
|
|
3695
|
-
updateItem(key, value) {
|
|
3696
|
-
this.map.delete(key);
|
|
3697
|
-
this.map.set(key, value);
|
|
3698
|
-
}
|
|
3699
|
-
/**
|
|
3700
|
-
* Return the earliest key inserted in the Map
|
|
3701
|
-
*/
|
|
3702
|
-
getColdestKey() {
|
|
3703
|
-
return es2018Exports.first(this.map.keys());
|
|
3704
|
-
}
|
|
3705
|
-
}
|
|
3706
|
-
|
|
3707
|
-
class ExpirableMap {
|
|
3708
|
-
constructor() {
|
|
3709
|
-
this.map = new Map();
|
|
3710
|
-
/**
|
|
3711
|
-
* 按过期时间升序排列所有项目的元数据
|
|
3712
|
-
*/
|
|
3713
|
-
this.itemMetadataSortedByExpirationTime = [];
|
|
3714
|
-
}
|
|
3715
|
-
get [Symbol.toStringTag]() {
|
|
3716
|
-
return this.constructor.name;
|
|
3717
|
-
}
|
|
3718
|
-
get size() {
|
|
3719
|
-
return this.map.size;
|
|
3720
|
-
}
|
|
3721
|
-
set(key, value, maxAge) {
|
|
3722
|
-
this.map.set(key, value);
|
|
3723
|
-
this.removeItemMetadata(key);
|
|
3724
|
-
this.addItemMetadata(key, Date.now() + maxAge);
|
|
3725
|
-
return this;
|
|
3726
|
-
}
|
|
3727
|
-
has(key) {
|
|
3728
|
-
return this.map.has(key);
|
|
3729
|
-
}
|
|
3730
|
-
get(key) {
|
|
3731
|
-
return this.map.get(key);
|
|
3732
|
-
}
|
|
3733
|
-
delete(key) {
|
|
3734
|
-
const exists = this.map.delete(key);
|
|
3735
|
-
if (exists) {
|
|
3736
|
-
const index = this.itemMetadataSortedByExpirationTime.findIndex(x => x.key === key);
|
|
3737
|
-
this.itemMetadataSortedByExpirationTime.splice(index, 1);
|
|
3738
|
-
// 如果被删除的项目是第一个项目, 则需要重新规划过期回调
|
|
3739
|
-
if (index === 0) {
|
|
3740
|
-
this.rescheduleClearTimeout();
|
|
3741
|
-
}
|
|
3742
|
-
}
|
|
3743
|
-
return exists;
|
|
3744
|
-
}
|
|
3745
|
-
clear() {
|
|
3746
|
-
var _a;
|
|
3747
|
-
this.map.clear();
|
|
3748
|
-
(_a = this.cancelClearTimeout) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
3749
|
-
this.itemMetadataSortedByExpirationTime = [];
|
|
3750
|
-
}
|
|
3751
|
-
addItemMetadata(key, expirationTime) {
|
|
3752
|
-
for (let i = 0; i < this.itemMetadataSortedByExpirationTime.length; i++) {
|
|
3753
|
-
const item = this.itemMetadataSortedByExpirationTime[i];
|
|
3754
|
-
if (expirationTime < item.expirationTime) {
|
|
3755
|
-
this.itemMetadataSortedByExpirationTime.splice(i, 0, { key, expirationTime });
|
|
3756
|
-
// 如果本次插入导致原先的第一个项目不再是低一个项目, 则需要重新规划过期回调
|
|
3757
|
-
if (i === 0) {
|
|
3758
|
-
this.rescheduleClearTimeout();
|
|
3759
|
-
}
|
|
3760
|
-
return;
|
|
3761
|
-
}
|
|
3762
|
-
}
|
|
3763
|
-
// 如果代码运行到此处, 意味着数组要么为空, 要么新项目过期时间大于数组内的所有项目, 故直接插入到数组尾端.
|
|
3764
|
-
this.itemMetadataSortedByExpirationTime.push({ key, expirationTime });
|
|
3765
|
-
// 如果新插入的项目是唯一而项目, 则需要重新规划过期回调
|
|
3766
|
-
if (this.itemMetadataSortedByExpirationTime.length === 1) {
|
|
3767
|
-
this.rescheduleClearTimeout();
|
|
3768
|
-
}
|
|
3769
|
-
}
|
|
3770
|
-
removeItemMetadata(key) {
|
|
3771
|
-
const index = this.itemMetadataSortedByExpirationTime.findIndex(x => x.key === key);
|
|
3772
|
-
if (index >= 0) {
|
|
3773
|
-
this.itemMetadataSortedByExpirationTime.splice(index, 1);
|
|
3774
|
-
// 如果被移除的是第一个项目, 则需要重新规划过期回调
|
|
3775
|
-
if (index === 0) {
|
|
3776
|
-
this.rescheduleClearTimeout();
|
|
3777
|
-
}
|
|
3778
|
-
}
|
|
3779
|
-
}
|
|
3780
|
-
clearExpiredItems(timestamp) {
|
|
3781
|
-
const indexOfFirstUnexpired = this.itemMetadataSortedByExpirationTime.findIndex(x => x.expirationTime > timestamp);
|
|
3782
|
-
const expiredItemKeys = indexOfFirstUnexpired >= 0
|
|
3783
|
-
? this.itemMetadataSortedByExpirationTime.splice(0, indexOfFirstUnexpired)
|
|
3784
|
-
: this.itemMetadataSortedByExpirationTime.splice(0, this.itemMetadataSortedByExpirationTime.length);
|
|
3785
|
-
expiredItemKeys.forEach(x => this.map.delete(x.key));
|
|
3786
|
-
}
|
|
3787
|
-
rescheduleClearTimeout() {
|
|
3788
|
-
var _a;
|
|
3789
|
-
(_a = this.cancelClearTimeout) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
3790
|
-
if (this.itemMetadataSortedByExpirationTime.length > 0) {
|
|
3791
|
-
const item = this.itemMetadataSortedByExpirationTime[0];
|
|
3792
|
-
if (Number.isFinite(item.expirationTime)) {
|
|
3793
|
-
const cancel = es2018$5.setSchedule(item.expirationTime, () => {
|
|
3794
|
-
this.clearExpiredItems(Date.now());
|
|
3795
|
-
this.rescheduleClearTimeout();
|
|
3796
|
-
});
|
|
3797
|
-
this.cancelClearTimeout = () => {
|
|
3798
|
-
cancel();
|
|
3799
|
-
this.cancelClearTimeout = undefined;
|
|
3800
|
-
};
|
|
3801
|
-
}
|
|
3802
|
-
}
|
|
3803
|
-
}
|
|
3804
|
-
}
|
|
3805
|
-
|
|
3806
|
-
/**
|
|
3807
|
-
* TLRUMap = LRUMap + ExpirableMap
|
|
3808
|
-
*/
|
|
3809
|
-
class TLRUMap {
|
|
3810
|
-
constructor(limit) {
|
|
3811
|
-
this.map = new Map();
|
|
3812
|
-
/**
|
|
3813
|
-
* 按过期时间升序排列所有项目的元数据
|
|
3814
|
-
*/
|
|
3815
|
-
this.itemMetadataSortedByExpirationTime = [];
|
|
3816
|
-
es2018Exports$1.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
|
|
3817
|
-
es2018Exports$1.assert(limit > 0, 'The parameter limit must be a positive value');
|
|
3818
|
-
this.limit = limit;
|
|
3819
|
-
}
|
|
3820
|
-
get [Symbol.toStringTag]() {
|
|
3821
|
-
return this.constructor.name;
|
|
3822
|
-
}
|
|
3823
|
-
get size() {
|
|
3824
|
-
return this.map.size;
|
|
3825
|
-
}
|
|
3826
|
-
set(key, value, maxAge) {
|
|
3827
|
-
if (this.map.has(key)) {
|
|
3828
|
-
this.updateItem(key, value);
|
|
3829
|
-
this.removeItemMetadata(key);
|
|
3830
|
-
this.addItemMetadata(key, Date.now() + maxAge);
|
|
3831
|
-
}
|
|
3832
|
-
else {
|
|
3833
|
-
if (this.map.size === this.limit) {
|
|
3834
|
-
this.map.delete(this.getColdestKey());
|
|
3835
|
-
}
|
|
3836
|
-
this.map.set(key, value);
|
|
3837
|
-
this.addItemMetadata(key, Date.now() + maxAge);
|
|
3838
|
-
}
|
|
3839
|
-
return this;
|
|
3840
|
-
}
|
|
3841
|
-
has(key) {
|
|
3842
|
-
return this.map.has(key);
|
|
3843
|
-
}
|
|
3844
|
-
get(key) {
|
|
3845
|
-
if (this.has(key)) {
|
|
3846
|
-
const value = this.map.get(key);
|
|
3847
|
-
this.updateItem(key, value);
|
|
3848
|
-
return value;
|
|
3849
|
-
}
|
|
3850
|
-
else {
|
|
3851
|
-
return undefined;
|
|
3852
|
-
}
|
|
3853
|
-
}
|
|
3854
|
-
delete(key) {
|
|
3855
|
-
const result = this.map.delete(key);
|
|
3856
|
-
if (result) {
|
|
3857
|
-
const index = this.itemMetadataSortedByExpirationTime.findIndex(x => x.key === key);
|
|
3858
|
-
this.itemMetadataSortedByExpirationTime.splice(index, 1);
|
|
3859
|
-
// 如果被删除的项目是第一个项目, 则需要重新规划过期回调
|
|
3860
|
-
if (index === 0) {
|
|
3861
|
-
this.rescheduleClearTimeout();
|
|
3862
|
-
}
|
|
3863
|
-
}
|
|
3864
|
-
return result;
|
|
3865
|
-
}
|
|
3866
|
-
clear() {
|
|
3867
|
-
var _a;
|
|
3868
|
-
this.map.clear();
|
|
3869
|
-
(_a = this.cancelClearTimeout) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
3870
|
-
this.itemMetadataSortedByExpirationTime = [];
|
|
3871
|
-
}
|
|
3872
|
-
/**
|
|
3873
|
-
* 重新插入项目, 这会使项目置于#map迭代器的末端.
|
|
3874
|
-
*/
|
|
3875
|
-
updateItem(key, value) {
|
|
3876
|
-
this.map.delete(key);
|
|
3877
|
-
this.map.set(key, value);
|
|
3878
|
-
}
|
|
3879
|
-
addItemMetadata(key, expirationTime) {
|
|
3880
|
-
for (let i = 0; i < this.itemMetadataSortedByExpirationTime.length; i++) {
|
|
3881
|
-
const item = this.itemMetadataSortedByExpirationTime[i];
|
|
3882
|
-
if (expirationTime < item.expirationTime) {
|
|
3883
|
-
this.itemMetadataSortedByExpirationTime.splice(i, 0, { key, expirationTime });
|
|
3884
|
-
// 如果本次插入导致原先的第一个项目不再是低一个项目, 则需要重新规划过期回调
|
|
3885
|
-
if (i === 0) {
|
|
3886
|
-
this.rescheduleClearTimeout();
|
|
3887
|
-
}
|
|
3888
|
-
return;
|
|
3889
|
-
}
|
|
3890
|
-
}
|
|
3891
|
-
// 如果代码运行到此处, 意味着数组要么为空, 要么新项目过期时间大于数组内的所有项目, 故直接插入到数组尾端.
|
|
3892
|
-
this.itemMetadataSortedByExpirationTime.push({ key, expirationTime });
|
|
3893
|
-
// 如果新插入的项目是唯一而项目, 则需要重新规划过期回调
|
|
3894
|
-
if (this.itemMetadataSortedByExpirationTime.length === 1) {
|
|
3895
|
-
this.rescheduleClearTimeout();
|
|
3896
|
-
}
|
|
3897
|
-
}
|
|
3898
|
-
removeItemMetadata(key) {
|
|
3899
|
-
const index = this.itemMetadataSortedByExpirationTime.findIndex(x => x.key === key);
|
|
3900
|
-
if (index >= 0) {
|
|
3901
|
-
this.itemMetadataSortedByExpirationTime.splice(index, 1);
|
|
3902
|
-
// 如果被移除的是第一个项目, 则需要重新规划过期回调
|
|
3903
|
-
if (index === 0) {
|
|
3904
|
-
this.rescheduleClearTimeout();
|
|
3905
|
-
}
|
|
3906
|
-
}
|
|
3907
|
-
}
|
|
3908
|
-
clearExpiredItems(timestamp) {
|
|
3909
|
-
const indexOfFirstUnexpiredItem = this.itemMetadataSortedByExpirationTime.findIndex(x => x.expirationTime > timestamp);
|
|
3910
|
-
const expiredItemKeys = indexOfFirstUnexpiredItem >= 0
|
|
3911
|
-
? this.itemMetadataSortedByExpirationTime.splice(0, indexOfFirstUnexpiredItem)
|
|
3912
|
-
: this.itemMetadataSortedByExpirationTime.splice(0, this.itemMetadataSortedByExpirationTime.length);
|
|
3913
|
-
expiredItemKeys.forEach(x => this.map.delete(x.key));
|
|
3914
|
-
}
|
|
3915
|
-
rescheduleClearTimeout() {
|
|
3916
|
-
var _a;
|
|
3917
|
-
(_a = this.cancelClearTimeout) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
3918
|
-
if (this.itemMetadataSortedByExpirationTime.length > 0) {
|
|
3919
|
-
const item = this.itemMetadataSortedByExpirationTime[0];
|
|
3920
|
-
if (Number.isFinite(item.expirationTime)) {
|
|
3921
|
-
const cancel = es2018$5.setSchedule(item.expirationTime, () => {
|
|
3922
|
-
this.clearExpiredItems(Date.now());
|
|
3923
|
-
this.rescheduleClearTimeout();
|
|
3924
|
-
});
|
|
3925
|
-
this.cancelClearTimeout = () => {
|
|
3926
|
-
cancel();
|
|
3927
|
-
this.cancelClearTimeout = undefined;
|
|
3928
|
-
};
|
|
3929
|
-
}
|
|
3930
|
-
}
|
|
3931
|
-
}
|
|
3932
|
-
/**
|
|
3933
|
-
* Return the earliest key inserted in the Map
|
|
3934
|
-
*/
|
|
3935
|
-
getColdestKey() {
|
|
3936
|
-
return es2018Exports.first(this.map.keys());
|
|
3937
|
-
}
|
|
3938
|
-
}
|
|
3939
|
-
|
|
3940
|
-
class TrieNode {
|
|
3941
|
-
constructor(value) {
|
|
3942
|
-
this.value = value;
|
|
3943
|
-
this.children = new Map();
|
|
3944
|
-
}
|
|
3945
|
-
}
|
|
3946
|
-
class TrieMap {
|
|
3947
|
-
constructor() {
|
|
3948
|
-
this.root = new TrieNode();
|
|
3949
|
-
}
|
|
3950
|
-
get [Symbol.toStringTag]() {
|
|
3951
|
-
return this.constructor.name;
|
|
3952
|
-
}
|
|
3953
|
-
*entries() {
|
|
3954
|
-
yield* dfs(this.root, []);
|
|
3955
|
-
function* dfs(node, paths) {
|
|
3956
|
-
for (const [path, childNode] of node.children) {
|
|
3957
|
-
const newPaths = [...paths, path];
|
|
3958
|
-
if (es2018$7.isntUndefined(childNode.value)) {
|
|
3959
|
-
yield [newPaths, childNode.value];
|
|
3960
|
-
}
|
|
3961
|
-
yield* dfs(childNode, newPaths);
|
|
3962
|
-
}
|
|
3963
|
-
}
|
|
3964
|
-
}
|
|
3965
|
-
keys() {
|
|
3966
|
-
return es2018Exports.map(this.entries(), ([key]) => key);
|
|
3967
|
-
}
|
|
3968
|
-
values() {
|
|
3969
|
-
return es2018Exports.map(this.entries(), ([_, value]) => value);
|
|
3970
|
-
}
|
|
3971
|
-
set(key, value) {
|
|
3972
|
-
let node = this.root;
|
|
3973
|
-
for (const part of key) {
|
|
3974
|
-
if (!node.children.has(part)) {
|
|
3975
|
-
node.children.set(part, new TrieNode());
|
|
3976
|
-
}
|
|
3977
|
-
node = node.children.get(part);
|
|
3978
|
-
}
|
|
3979
|
-
node.value = value;
|
|
3980
|
-
return this;
|
|
3981
|
-
}
|
|
3982
|
-
has(key) {
|
|
3983
|
-
let node = this.root;
|
|
3984
|
-
for (const part of key) {
|
|
3985
|
-
if (node.children.has(part)) {
|
|
3986
|
-
node = node.children.get(part);
|
|
3987
|
-
}
|
|
3988
|
-
else {
|
|
3989
|
-
return false;
|
|
3990
|
-
}
|
|
3991
|
-
}
|
|
3992
|
-
return node.value !== undefined;
|
|
3993
|
-
}
|
|
3994
|
-
get(key) {
|
|
3995
|
-
let node = this.root;
|
|
3996
|
-
for (const part of key) {
|
|
3997
|
-
if (node.children.has(part)) {
|
|
3998
|
-
node = node.children.get(part);
|
|
3999
|
-
}
|
|
4000
|
-
else {
|
|
4001
|
-
return undefined;
|
|
4002
|
-
}
|
|
4003
|
-
}
|
|
4004
|
-
return node.value;
|
|
4005
|
-
}
|
|
4006
|
-
delete(key) {
|
|
4007
|
-
const parentNodes = [];
|
|
4008
|
-
let node = this.root;
|
|
4009
|
-
for (const part of key) {
|
|
4010
|
-
if (node.children.has(part)) {
|
|
4011
|
-
parentNodes.push(node);
|
|
4012
|
-
node = node.children.get(part);
|
|
4013
|
-
}
|
|
4014
|
-
else {
|
|
4015
|
-
return false;
|
|
4016
|
-
}
|
|
4017
|
-
}
|
|
4018
|
-
delete node.value;
|
|
4019
|
-
// 如果节点没有后缀, 则代表这是末端节点, 往前删除其前缀
|
|
4020
|
-
if (node.children.size === 0) {
|
|
4021
|
-
for (const [part, parentNode] of es2018Exports.toArray(es2018Exports.zip(key, parentNodes)).reverse()) {
|
|
4022
|
-
parentNode.children.delete(part);
|
|
4023
|
-
if (parentNode.children.size !== 0)
|
|
4024
|
-
break;
|
|
4025
|
-
}
|
|
4026
|
-
}
|
|
4027
|
-
return true;
|
|
4028
|
-
}
|
|
4029
|
-
}
|
|
4030
|
-
|
|
4031
|
-
class SparseSet {
|
|
4032
|
-
constructor(array = []) {
|
|
4033
|
-
this.indexToValue = [];
|
|
4034
|
-
const valueToIndex = [];
|
|
4035
|
-
if (array.length > 0) {
|
|
4036
|
-
for (const [index, value] of array.entries()) {
|
|
4037
|
-
valueToIndex[value] = index;
|
|
4038
|
-
}
|
|
4039
|
-
}
|
|
4040
|
-
this.valueToIndex = valueToIndex;
|
|
4041
|
-
}
|
|
4042
|
-
get [Symbol.toStringTag]() {
|
|
4043
|
-
return this.constructor.name;
|
|
4044
|
-
}
|
|
4045
|
-
[Symbol.iterator]() {
|
|
4046
|
-
return this.indexToValue[Symbol.iterator]();
|
|
4047
|
-
}
|
|
4048
|
-
values() {
|
|
4049
|
-
return this.indexToValue[Symbol.iterator]();
|
|
4050
|
-
}
|
|
4051
|
-
has(value) {
|
|
4052
|
-
// 跟一般的实现不同, 不需要访问values数组.
|
|
4053
|
-
return value in this.valueToIndex;
|
|
4054
|
-
}
|
|
4055
|
-
add(value) {
|
|
4056
|
-
if (!this.has(value)) {
|
|
4057
|
-
const index = this.indexToValue.length;
|
|
4058
|
-
this.indexToValue.push(value);
|
|
4059
|
-
this.valueToIndex[value] = index;
|
|
4060
|
-
}
|
|
4061
|
-
}
|
|
4062
|
-
delete(value) {
|
|
4063
|
-
if (this.has(value)) {
|
|
4064
|
-
const lastValue = this.indexToValue.pop();
|
|
4065
|
-
if (value === lastValue) {
|
|
4066
|
-
delete this.valueToIndex[value];
|
|
4067
|
-
}
|
|
4068
|
-
else {
|
|
4069
|
-
const index = this.valueToIndex[value];
|
|
4070
|
-
this.indexToValue[index] = lastValue;
|
|
4071
|
-
this.valueToIndex[lastValue] = index;
|
|
4072
|
-
// 跟一般的实现不同, 直接删除值的索引.
|
|
4073
|
-
delete this.valueToIndex[value];
|
|
4074
|
-
}
|
|
4075
|
-
return true;
|
|
4076
|
-
}
|
|
4077
|
-
else {
|
|
4078
|
-
return false;
|
|
4079
|
-
}
|
|
4080
|
-
}
|
|
4081
|
-
}
|
|
4082
|
-
|
|
4083
|
-
class SparseMap {
|
|
4084
|
-
constructor() {
|
|
4085
|
-
this.keyToIndex = [];
|
|
4086
|
-
this.indexToKey = [];
|
|
4087
|
-
this.indexToValue = [];
|
|
4088
|
-
}
|
|
4089
|
-
get [Symbol.toStringTag]() {
|
|
4090
|
-
return this.constructor.name;
|
|
4091
|
-
}
|
|
4092
|
-
get size() {
|
|
4093
|
-
return this.indexToKey.length;
|
|
4094
|
-
}
|
|
4095
|
-
get internalArray() {
|
|
4096
|
-
return this.indexToValue;
|
|
4097
|
-
}
|
|
4098
|
-
*entries() {
|
|
4099
|
-
for (let i = 0; i < this.indexToKey.length; i++) {
|
|
4100
|
-
yield [this.indexToKey[i], this.indexToValue[i]];
|
|
4101
|
-
}
|
|
4102
|
-
}
|
|
4103
|
-
keys() {
|
|
4104
|
-
return this.indexToKey.values();
|
|
4105
|
-
}
|
|
4106
|
-
values() {
|
|
4107
|
-
return this.indexToValue.values();
|
|
4108
|
-
}
|
|
4109
|
-
getInternalIndexOfKey(key) {
|
|
4110
|
-
return this.keyToIndex[key];
|
|
4111
|
-
}
|
|
4112
|
-
has(key) {
|
|
4113
|
-
// 跟一般的稀疏集实现不同, 不需要访问values数组.
|
|
4114
|
-
return key in this.keyToIndex;
|
|
4115
|
-
}
|
|
4116
|
-
get(key) {
|
|
4117
|
-
if (this.has(key)) {
|
|
4118
|
-
const index = this.keyToIndex[key];
|
|
4119
|
-
return this.indexToValue[index];
|
|
4120
|
-
}
|
|
4121
|
-
else {
|
|
4122
|
-
return undefined;
|
|
4123
|
-
}
|
|
4124
|
-
}
|
|
4125
|
-
set(key, value) {
|
|
4126
|
-
if (this.has(key)) {
|
|
4127
|
-
const index = this.keyToIndex[key];
|
|
4128
|
-
this.indexToValue[index] = value;
|
|
4129
|
-
}
|
|
4130
|
-
else {
|
|
4131
|
-
const index = this.indexToKey.length;
|
|
4132
|
-
this.indexToKey.push(key);
|
|
4133
|
-
this.indexToValue.push(value);
|
|
4134
|
-
this.keyToIndex[key] = index;
|
|
4135
|
-
}
|
|
4136
|
-
}
|
|
4137
|
-
delete(key) {
|
|
4138
|
-
if (this.has(key)) {
|
|
4139
|
-
const lastKey = this.indexToKey.pop();
|
|
4140
|
-
const lastValue = this.indexToValue.pop();
|
|
4141
|
-
if (key === lastKey) {
|
|
4142
|
-
delete this.keyToIndex[key];
|
|
4143
|
-
}
|
|
4144
|
-
else {
|
|
4145
|
-
const index = this.keyToIndex[key];
|
|
4146
|
-
this.indexToKey[index] = lastKey;
|
|
4147
|
-
this.indexToValue[index] = lastValue;
|
|
4148
|
-
this.keyToIndex[lastKey] = index;
|
|
4149
|
-
delete this.keyToIndex[key];
|
|
4150
|
-
}
|
|
4151
|
-
}
|
|
4152
|
-
}
|
|
4153
|
-
}
|
|
4154
|
-
|
|
4155
|
-
class TypedSparseMap {
|
|
4156
|
-
constructor(array) {
|
|
4157
|
-
this.keyToIndex = [];
|
|
4158
|
-
this.indexToKey = [];
|
|
4159
|
-
es2018Exports$1.assert(array.length === 0, 'array should be empty');
|
|
4160
|
-
this.indexToValue = array;
|
|
4161
|
-
}
|
|
4162
|
-
get [Symbol.toStringTag]() {
|
|
4163
|
-
return this.constructor.name;
|
|
4164
|
-
}
|
|
4165
|
-
get size() {
|
|
4166
|
-
return this.indexToKey.length;
|
|
4167
|
-
}
|
|
4168
|
-
get internalTypedArray() {
|
|
4169
|
-
return this.indexToValue.internalTypedArray;
|
|
4170
|
-
}
|
|
4171
|
-
*entries() {
|
|
4172
|
-
for (let i = 0; i < this.indexToKey.length; i++) {
|
|
4173
|
-
yield [
|
|
4174
|
-
this.indexToKey[i],
|
|
4175
|
-
this.indexToValue.internalTypedArray[i]
|
|
4176
|
-
];
|
|
4177
|
-
}
|
|
4178
|
-
}
|
|
4179
|
-
keys() {
|
|
4180
|
-
return this.indexToKey.values();
|
|
4181
|
-
}
|
|
4182
|
-
*values() {
|
|
4183
|
-
for (let i = 0; i < this.indexToKey.length; i++) {
|
|
4184
|
-
yield this.indexToValue.internalTypedArray[i];
|
|
4185
|
-
}
|
|
4186
|
-
}
|
|
4187
|
-
getInternalIndexOfKey(key) {
|
|
4188
|
-
return this.keyToIndex[key];
|
|
4189
|
-
}
|
|
4190
|
-
has(key) {
|
|
4191
|
-
const index = this.keyToIndex[key];
|
|
4192
|
-
return this.indexToKey[index] === key;
|
|
4193
|
-
}
|
|
4194
|
-
get(key) {
|
|
4195
|
-
const index = this.keyToIndex[key];
|
|
4196
|
-
if (this.indexToKey[index] === key) {
|
|
4197
|
-
return this.indexToValue.internalTypedArray[index];
|
|
4198
|
-
}
|
|
4199
|
-
else {
|
|
4200
|
-
return undefined;
|
|
4201
|
-
}
|
|
4202
|
-
}
|
|
4203
|
-
set(key, value) {
|
|
4204
|
-
const index = this.keyToIndex[key];
|
|
4205
|
-
if (this.indexToKey[index] === key) {
|
|
4206
|
-
this.indexToValue.internalTypedArray[index] = value;
|
|
4207
|
-
}
|
|
4208
|
-
else {
|
|
4209
|
-
const index = this.indexToKey.length;
|
|
4210
|
-
this.indexToKey.push(key);
|
|
4211
|
-
this.indexToValue.push(value);
|
|
4212
|
-
this.keyToIndex[key] = index;
|
|
4213
|
-
}
|
|
4214
|
-
}
|
|
4215
|
-
delete(key) {
|
|
4216
|
-
const index = this.keyToIndex[key];
|
|
4217
|
-
if (this.indexToKey[index] === key) {
|
|
4218
|
-
const lastKey = this.indexToKey.pop();
|
|
4219
|
-
const lastValue = this.indexToValue.pop();
|
|
4220
|
-
if (key !== lastKey) {
|
|
4221
|
-
this.indexToKey[index] = lastKey;
|
|
4222
|
-
this.indexToValue.internalTypedArray[index] = lastValue;
|
|
4223
|
-
this.keyToIndex[lastKey] = index;
|
|
4224
|
-
}
|
|
4225
|
-
}
|
|
4226
|
-
}
|
|
4227
|
-
}
|
|
4228
|
-
|
|
4229
|
-
class TypedSparseSet {
|
|
4230
|
-
constructor(array) {
|
|
4231
|
-
const valueToIndex = [];
|
|
4232
|
-
if (array.length > 0) {
|
|
4233
|
-
for (const [index, value] of array.internalTypedArray.entries()) {
|
|
4234
|
-
valueToIndex[value] = index;
|
|
4235
|
-
}
|
|
4236
|
-
}
|
|
4237
|
-
this.indexToValue = array;
|
|
4238
|
-
this.valueToIndex = valueToIndex;
|
|
4239
|
-
}
|
|
4240
|
-
get [Symbol.toStringTag]() {
|
|
4241
|
-
return this.constructor.name;
|
|
4242
|
-
}
|
|
4243
|
-
[Symbol.iterator]() {
|
|
4244
|
-
return this.values();
|
|
4245
|
-
}
|
|
4246
|
-
*values() {
|
|
4247
|
-
for (let i = 0; i < this.indexToValue.length; i++) {
|
|
4248
|
-
yield this.indexToValue.internalTypedArray[i];
|
|
4249
|
-
}
|
|
4250
|
-
}
|
|
4251
|
-
has(value) {
|
|
4252
|
-
const index = this.valueToIndex[value];
|
|
4253
|
-
return this.indexToValue.internalTypedArray[index] === value;
|
|
4254
|
-
}
|
|
4255
|
-
add(value) {
|
|
4256
|
-
if (!this.has(value)) {
|
|
4257
|
-
const index = this.indexToValue.length;
|
|
4258
|
-
this.indexToValue.push(value);
|
|
4259
|
-
this.valueToIndex[value] = index;
|
|
4260
|
-
}
|
|
4261
|
-
}
|
|
4262
|
-
delete(value) {
|
|
4263
|
-
const index = this.valueToIndex[value];
|
|
4264
|
-
if (this.indexToValue.internalTypedArray[index] === value) {
|
|
4265
|
-
const lastValue = this.indexToValue.pop();
|
|
4266
|
-
if (value !== lastValue) {
|
|
4267
|
-
this.indexToValue.internalTypedArray[index] = lastValue;
|
|
4268
|
-
this.valueToIndex[lastValue] = index;
|
|
4269
|
-
}
|
|
4270
|
-
return true;
|
|
4271
|
-
}
|
|
4272
|
-
else {
|
|
4273
|
-
return false;
|
|
4274
|
-
}
|
|
4275
|
-
}
|
|
4276
|
-
}
|
|
4277
|
-
|
|
4278
|
-
// 相关提案: https://github.com/tc39/proposal-resizablearraybuffer
|
|
4279
|
-
class DynamicTypedArray {
|
|
4280
|
-
constructor(typedArrayConstructor, { capacity = 0, growthFactor = 1.5 } = {}) {
|
|
4281
|
-
this.typedArrayConstructor = typedArrayConstructor;
|
|
4282
|
-
this._length = 0;
|
|
4283
|
-
es2018Exports$1.assert(Number.isInteger(capacity), 'capacity must be an integer');
|
|
4284
|
-
es2018Exports$1.assert(capacity >= 0, 'capacity must be greater than or equal to 0');
|
|
4285
|
-
es2018Exports$1.assert(growthFactor >= 1, 'growthFactory must be greater than or equal to 1');
|
|
4286
|
-
this.array = new typedArrayConstructor(capacity);
|
|
4287
|
-
this.growthFactor = growthFactor;
|
|
4288
|
-
}
|
|
4289
|
-
get internalTypedArray() {
|
|
4290
|
-
return this.array;
|
|
4291
|
-
}
|
|
4292
|
-
get [Symbol.toStringTag]() {
|
|
4293
|
-
return this.constructor.name;
|
|
4294
|
-
}
|
|
4295
|
-
get BYTES_PER_ELEMENT() {
|
|
4296
|
-
return this.typedArrayConstructor.BYTES_PER_ELEMENT;
|
|
4297
|
-
}
|
|
4298
|
-
/**
|
|
4299
|
-
* 数组当前的容量.
|
|
4300
|
-
*/
|
|
4301
|
-
get capacity() {
|
|
4302
|
-
return this.array.length;
|
|
4303
|
-
}
|
|
4304
|
-
/**
|
|
4305
|
-
* 数组逻辑上的长度, 总是小于或等于capacity.
|
|
4306
|
-
*/
|
|
4307
|
-
get length() {
|
|
4308
|
-
return this._length;
|
|
4309
|
-
}
|
|
4310
|
-
set(index, value) {
|
|
4311
|
-
if (index >= this.capacity) {
|
|
4312
|
-
const newCapacity = computeNewCapacity(this.capacity, index + 1, this.growthFactor);
|
|
4313
|
-
this.resize(newCapacity);
|
|
4314
|
-
}
|
|
4315
|
-
if (index >= this._length) {
|
|
4316
|
-
this._length = index + 1;
|
|
4317
|
-
}
|
|
4318
|
-
this.array[index] = value;
|
|
4319
|
-
}
|
|
4320
|
-
get(index) {
|
|
4321
|
-
return index < this._length
|
|
4322
|
-
? this.array[index]
|
|
4323
|
-
: undefined;
|
|
4324
|
-
}
|
|
4325
|
-
push(...values) {
|
|
4326
|
-
const newLength = this._length + values.length;
|
|
4327
|
-
if (newLength > this.capacity) {
|
|
4328
|
-
const newCapacity = computeNewCapacity(this.capacity, newLength, this.growthFactor);
|
|
4329
|
-
this.resize(newCapacity);
|
|
4330
|
-
}
|
|
4331
|
-
for (const value of values) {
|
|
4332
|
-
this.array[this._length++] = value;
|
|
4333
|
-
}
|
|
4334
|
-
}
|
|
4335
|
-
pop() {
|
|
4336
|
-
if (this._length > 0) {
|
|
4337
|
-
const value = this.array[this._length - 1];
|
|
4338
|
-
this._length--;
|
|
4339
|
-
const newCapacity = computeNewCapacity(this.capacity, this.length, this.growthFactor);
|
|
4340
|
-
this.resize(newCapacity);
|
|
4341
|
-
return value;
|
|
4342
|
-
}
|
|
4343
|
-
else {
|
|
4344
|
-
return undefined;
|
|
4345
|
-
}
|
|
4346
|
-
}
|
|
4347
|
-
sort(compare) {
|
|
4348
|
-
const capacity = this.capacity;
|
|
4349
|
-
this.resize(this.length);
|
|
4350
|
-
this.array.sort(compare);
|
|
4351
|
-
this.resize(capacity);
|
|
4352
|
-
}
|
|
4353
|
-
resize(newCapacity) {
|
|
4354
|
-
if (this.array.length === newCapacity) {
|
|
4355
|
-
return;
|
|
4356
|
-
}
|
|
4357
|
-
else if (this.array.length < newCapacity) {
|
|
4358
|
-
const newArray = new this.typedArrayConstructor(newCapacity);
|
|
4359
|
-
newArray.set(this.array);
|
|
4360
|
-
this.array = newArray;
|
|
4361
|
-
}
|
|
4362
|
-
else if (this.array.length > newCapacity) {
|
|
4363
|
-
const newArray = new this.typedArrayConstructor(newCapacity);
|
|
4364
|
-
// 不需要的部分将被舍弃.
|
|
4365
|
-
for (let i = newCapacity; i--;) {
|
|
4366
|
-
newArray[i] = this.array[i];
|
|
4367
|
-
}
|
|
4368
|
-
this.array = newArray;
|
|
4369
|
-
}
|
|
4370
|
-
}
|
|
4371
|
-
}
|
|
4372
|
-
function computeNewCapacity(oldCapacity, targetLength, growthFactor) {
|
|
4373
|
-
if (growthFactor === 1) {
|
|
4374
|
-
return targetLength;
|
|
4375
|
-
}
|
|
4376
|
-
else {
|
|
4377
|
-
if (oldCapacity === targetLength) {
|
|
4378
|
-
return targetLength;
|
|
4379
|
-
}
|
|
4380
|
-
else if (oldCapacity < targetLength) {
|
|
4381
|
-
// 增加容量以适配targetLength
|
|
4382
|
-
let newCapacity = Math.max(oldCapacity, 1);
|
|
4383
|
-
while (newCapacity < targetLength) {
|
|
4384
|
-
newCapacity *= growthFactor;
|
|
4385
|
-
}
|
|
4386
|
-
return Math.floor(newCapacity);
|
|
4387
|
-
}
|
|
4388
|
-
else {
|
|
4389
|
-
// 尝试减少容量以适配targetLength
|
|
4390
|
-
// `targetLength = 0`是特殊情况,
|
|
4391
|
-
// 此时无论怎么将oldCapacity除以growthFactory几次, 都不可能得到比targetLength小的结果.
|
|
4392
|
-
if (targetLength === 0) {
|
|
4393
|
-
return 0;
|
|
4394
|
-
}
|
|
4395
|
-
else {
|
|
4396
|
-
let newCapacity = oldCapacity;
|
|
4397
|
-
while (true) {
|
|
4398
|
-
const temp = newCapacity / growthFactor;
|
|
4399
|
-
if (temp < targetLength) {
|
|
4400
|
-
break;
|
|
4401
|
-
}
|
|
4402
|
-
else {
|
|
4403
|
-
newCapacity = temp;
|
|
4404
|
-
}
|
|
4405
|
-
}
|
|
4406
|
-
return Math.floor(newCapacity);
|
|
4407
|
-
}
|
|
4408
|
-
}
|
|
4409
|
-
}
|
|
4410
|
-
}
|
|
4411
|
-
|
|
4412
|
-
class SkipListNode {
|
|
4413
|
-
constructor(value) {
|
|
4414
|
-
this.value = value;
|
|
4415
|
-
this.previous = null;
|
|
4416
|
-
this.next = null;
|
|
4417
|
-
this.up = null;
|
|
4418
|
-
this.down = null;
|
|
4419
|
-
}
|
|
4420
|
-
}
|
|
4421
|
-
class SkipList {
|
|
4422
|
-
constructor(compare) {
|
|
4423
|
-
this.compare = compare;
|
|
4424
|
-
// 最顶层的首个节点
|
|
4425
|
-
this.head = new SkipListNode(null);
|
|
4426
|
-
// 最顶层的最后一个节点
|
|
4427
|
-
this.tail = new SkipListNode(null);
|
|
4428
|
-
this.height = 0;
|
|
4429
|
-
this._size = 0;
|
|
4430
|
-
this.head.next = this.tail;
|
|
4431
|
-
this.tail.previous = this.head;
|
|
4432
|
-
}
|
|
4433
|
-
// 元素数量
|
|
4434
|
-
get size() {
|
|
4435
|
-
return this._size;
|
|
4436
|
-
}
|
|
4437
|
-
*elements() {
|
|
4438
|
-
let currentNode = this.head;
|
|
4439
|
-
while (currentNode.down) {
|
|
4440
|
-
currentNode = currentNode.down;
|
|
4441
|
-
}
|
|
4442
|
-
while (currentNode.next && es2018$7.isntNull(currentNode.next.value)) {
|
|
4443
|
-
currentNode = currentNode.next;
|
|
4444
|
-
yield currentNode;
|
|
4445
|
-
}
|
|
4446
|
-
}
|
|
4447
|
-
dumpList() {
|
|
4448
|
-
const result = [];
|
|
4449
|
-
let head = this.head;
|
|
4450
|
-
do {
|
|
4451
|
-
result.push([]);
|
|
4452
|
-
let currentNode = head;
|
|
4453
|
-
do {
|
|
4454
|
-
result[result.length - 1].push(currentNode.value);
|
|
4455
|
-
currentNode = currentNode.next;
|
|
4456
|
-
} while (currentNode);
|
|
4457
|
-
} while (head = head.down);
|
|
4458
|
-
return result;
|
|
4459
|
-
}
|
|
4460
|
-
delete(value) {
|
|
4461
|
-
let currentNode = this.findNode(value);
|
|
4462
|
-
while (currentNode) {
|
|
4463
|
-
// 被删除的节点肯定不会是head或tail, 因此一定有previous
|
|
4464
|
-
currentNode.previous.next = currentNode.next;
|
|
4465
|
-
// 被删除的节点肯定不会是head或tail, 因此一定有next
|
|
4466
|
-
currentNode.next.previous = currentNode.previous;
|
|
4467
|
-
currentNode = currentNode.down;
|
|
4468
|
-
}
|
|
4469
|
-
this._size--;
|
|
4470
|
-
}
|
|
4471
|
-
has(value) {
|
|
4472
|
-
return es2018$7.isntNull(this.findNode(value));
|
|
4473
|
-
}
|
|
4474
|
-
findNode(value) {
|
|
4475
|
-
let currentNode = this.head;
|
|
4476
|
-
while (true) {
|
|
4477
|
-
while (currentNode.next && es2018$7.isntNull(currentNode.next.value)) {
|
|
4478
|
-
const result = this.compare(currentNode.next.value, value);
|
|
4479
|
-
if (result === 0) {
|
|
4480
|
-
return currentNode.next;
|
|
4481
|
-
}
|
|
4482
|
-
else if (result < 0) {
|
|
4483
|
-
currentNode = currentNode.next;
|
|
4484
|
-
}
|
|
4485
|
-
else {
|
|
4486
|
-
break;
|
|
4487
|
-
}
|
|
4488
|
-
}
|
|
4489
|
-
if (currentNode.down) {
|
|
4490
|
-
currentNode = currentNode.down;
|
|
4491
|
-
}
|
|
4492
|
-
else {
|
|
4493
|
-
return null;
|
|
4494
|
-
}
|
|
4495
|
-
}
|
|
4496
|
-
}
|
|
4497
|
-
add(value) {
|
|
4498
|
-
let previousNode = this.findPreviousNode(value);
|
|
4499
|
-
// 如果previousNode.next.value等于value, 则说明value已经存在
|
|
4500
|
-
if (previousNode.next &&
|
|
4501
|
-
es2018$7.isntNull(previousNode.next.value) &&
|
|
4502
|
-
this.compare(previousNode.next.value, value) === 0) {
|
|
4503
|
-
return;
|
|
4504
|
-
}
|
|
4505
|
-
let newNode = new SkipListNode(value);
|
|
4506
|
-
// 在底层加入新节点
|
|
4507
|
-
if (previousNode.next) {
|
|
4508
|
-
newNode.next = previousNode.next;
|
|
4509
|
-
previousNode.next.previous = newNode;
|
|
4510
|
-
}
|
|
4511
|
-
previousNode.next = newNode;
|
|
4512
|
-
newNode.previous = previousNode;
|
|
4513
|
-
// 在高层加入新节点, 具体加到多高是随机的, 从第一层(将其视作索引值0)开始建造
|
|
4514
|
-
// 层数非常高是极为罕见的, 因为每次建造层都会导致下一层被建造的概率减半.
|
|
4515
|
-
let level = 0;
|
|
4516
|
-
while (Math.random() < 0.5) {
|
|
4517
|
-
// currentLevel的索引与当前跳跃列表的高度相同, 需要在这之上建立一个新层
|
|
4518
|
-
if (level === this.height) {
|
|
4519
|
-
const newHead = new SkipListNode(null);
|
|
4520
|
-
const newTail = new SkipListNode(null);
|
|
4521
|
-
newHead.next = newTail;
|
|
4522
|
-
newHead.down = this.head;
|
|
4523
|
-
newTail.previous = newHead;
|
|
4524
|
-
newTail.down = this.tail;
|
|
4525
|
-
this.head.up = newHead;
|
|
4526
|
-
this.tail.up = newTail;
|
|
4527
|
-
this.head = newHead;
|
|
4528
|
-
this.tail = newTail;
|
|
4529
|
-
this.height++;
|
|
4530
|
-
}
|
|
4531
|
-
// 从新节点的前一个节点遍历, 直到找到能够通往上层的节点
|
|
4532
|
-
while (!previousNode.up) {
|
|
4533
|
-
// head节点必然会有up, 所以不可能访问进入循环体, 不可能访问`head.previous`
|
|
4534
|
-
previousNode = previousNode.previous;
|
|
4535
|
-
}
|
|
4536
|
-
// 上一层的对应节点
|
|
4537
|
-
previousNode = previousNode.up;
|
|
4538
|
-
// 创建新节点的上层节点
|
|
4539
|
-
const upperNewNode = new SkipListNode(value);
|
|
4540
|
-
if (previousNode.next) {
|
|
4541
|
-
upperNewNode.next = previousNode.next;
|
|
4542
|
-
previousNode.next.previous = upperNewNode;
|
|
4543
|
-
}
|
|
4544
|
-
previousNode.next = upperNewNode;
|
|
4545
|
-
upperNewNode.previous = previousNode;
|
|
4546
|
-
upperNewNode.down = newNode;
|
|
4547
|
-
newNode.up = upperNewNode;
|
|
4548
|
-
newNode = upperNewNode;
|
|
4549
|
-
level++;
|
|
4550
|
-
}
|
|
4551
|
-
this._size++;
|
|
4552
|
-
}
|
|
4553
|
-
findPreviousNode(value) {
|
|
4554
|
-
let currentNode = this.head;
|
|
4555
|
-
while (true) {
|
|
4556
|
-
while (currentNode.next && es2018$7.isntNull(currentNode.next.value)) {
|
|
4557
|
-
const result = this.compare(currentNode.next.value, value);
|
|
4558
|
-
if (result >= 0) {
|
|
4559
|
-
break;
|
|
4560
|
-
}
|
|
4561
|
-
else {
|
|
4562
|
-
currentNode = currentNode.next;
|
|
4563
|
-
}
|
|
4564
|
-
}
|
|
4565
|
-
if (currentNode.down) {
|
|
4566
|
-
currentNode = currentNode.down;
|
|
4567
|
-
}
|
|
4568
|
-
else {
|
|
4569
|
-
return currentNode;
|
|
4570
|
-
}
|
|
4571
|
-
}
|
|
4572
|
-
}
|
|
4573
|
-
}
|
|
4574
|
-
|
|
4575
|
-
class SortedSet {
|
|
4576
|
-
constructor(compare) {
|
|
4577
|
-
this.skipList = new SkipList(compare);
|
|
4578
|
-
}
|
|
4579
|
-
get [Symbol.toStringTag]() {
|
|
4580
|
-
return this.constructor.name;
|
|
4581
|
-
}
|
|
4582
|
-
[Symbol.iterator]() {
|
|
4583
|
-
return this.values();
|
|
4584
|
-
}
|
|
4585
|
-
values() {
|
|
4586
|
-
return es2018Exports.map(this.skipList.elements(), node => node.value);
|
|
4587
|
-
}
|
|
4588
|
-
has(value) {
|
|
4589
|
-
return this.skipList.has(value);
|
|
4590
|
-
}
|
|
4591
|
-
add(value) {
|
|
4592
|
-
this.skipList.add(value);
|
|
4593
|
-
}
|
|
4594
|
-
delete(value) {
|
|
4595
|
-
this.skipList.delete(value);
|
|
4596
|
-
}
|
|
4597
|
-
}
|
|
4598
|
-
|
|
4599
|
-
// http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightModLookup
|
|
4600
|
-
const mod37BitPositions = [
|
|
4601
|
-
32, 0, 1, 26, 2, 23, 27, 0, 3, 16,
|
|
4602
|
-
24, 30, 28, 11, 0, 13, 4, 7, 17, 0,
|
|
4603
|
-
25, 22, 31, 15, 29, 10, 12, 6, 0, 21,
|
|
4604
|
-
14, 9, 5, 20, 8, 19, 18
|
|
4605
|
-
];
|
|
4606
|
-
/**
|
|
4607
|
-
* 该函数在找不到结果时返回32, 与Rust内置函数的表现一致.
|
|
4608
|
-
* https://doc.rust-lang.org/std/primitive.u32.html#method.trailing_zeros
|
|
4609
|
-
*/
|
|
4610
|
-
function trailingZeros(value) {
|
|
4611
|
-
return mod37BitPositions[(-value & value) % 37];
|
|
4612
|
-
}
|
|
4613
|
-
|
|
4614
|
-
class BitSet {
|
|
4615
|
-
constructor(bitsPerElement = 8) {
|
|
4616
|
-
this.bitsPerElement = bitsPerElement;
|
|
4617
|
-
this.array = [];
|
|
4618
|
-
this.length = 0;
|
|
4619
|
-
this._size = 0;
|
|
4620
|
-
es2018Exports$1.assert(Number.isInteger(bitsPerElement), 'The parameter bitsPerElement must be an integer');
|
|
4621
|
-
es2018Exports$1.assert(bitsPerElement > 0, 'The parameter bitsPerElement must be greater than 0');
|
|
4622
|
-
// `31`是该数据结构中能够处理的最大值
|
|
4623
|
-
es2018Exports$1.assert(bitsPerElement <= 31, 'The mask of bitsPerElement must be less than or equal to 31');
|
|
4624
|
-
}
|
|
4625
|
-
get [Symbol.toStringTag]() {
|
|
4626
|
-
return this.constructor.name;
|
|
4627
|
-
}
|
|
4628
|
-
get size() {
|
|
4629
|
-
return this._size;
|
|
4630
|
-
}
|
|
4631
|
-
[Symbol.iterator]() {
|
|
4632
|
-
return this.values();
|
|
4633
|
-
}
|
|
4634
|
-
*values() {
|
|
4635
|
-
if (this.length > 0) {
|
|
4636
|
-
// maxArrayLength = Math.ceil(this.length / this.bitsPerElement)
|
|
4637
|
-
const maxArrayLength = ~~(this.length / this.bitsPerElement) + 1;
|
|
4638
|
-
for (let index = 0; index < maxArrayLength; index++) {
|
|
4639
|
-
let element = this.array[index];
|
|
4640
|
-
let offset = 0;
|
|
4641
|
-
let indexOfBit;
|
|
4642
|
-
while ((indexOfBit = trailingZeros(element)) !== 32) {
|
|
4643
|
-
yield index * this.bitsPerElement + offset + indexOfBit;
|
|
4644
|
-
offset += indexOfBit + 1;
|
|
4645
|
-
element >>= indexOfBit + 1;
|
|
4646
|
-
}
|
|
4647
|
-
}
|
|
4648
|
-
}
|
|
4649
|
-
}
|
|
4650
|
-
_dumpBinaryStrings() {
|
|
4651
|
-
const result = [];
|
|
4652
|
-
for (let i = 0; i < this.array.length; i++) {
|
|
4653
|
-
const binary = this.array[i].toString(2);
|
|
4654
|
-
if (binary.length < this.bitsPerElement) {
|
|
4655
|
-
result.push('0'.repeat(this.bitsPerElement - binary.length) + binary);
|
|
4656
|
-
}
|
|
4657
|
-
else {
|
|
4658
|
-
result.push(binary);
|
|
4659
|
-
}
|
|
4660
|
-
}
|
|
4661
|
-
return result;
|
|
4662
|
-
}
|
|
4663
|
-
has(value) {
|
|
4664
|
-
var _a;
|
|
4665
|
-
const [index, mask] = this.getPosition(value);
|
|
4666
|
-
return (((_a = this.array[index]) !== null && _a !== void 0 ? _a : 0) & mask) === mask;
|
|
4667
|
-
}
|
|
4668
|
-
add(value) {
|
|
4669
|
-
var _a;
|
|
4670
|
-
es2018Exports$1.assert(value >= 0, 'value must be greater than or equal to 0');
|
|
4671
|
-
if (value >= this.length) {
|
|
4672
|
-
this.length = value + 1;
|
|
4673
|
-
}
|
|
4674
|
-
const [index, mask] = this.getPosition(value);
|
|
4675
|
-
const element = (_a = this.array[index]) !== null && _a !== void 0 ? _a : 0;
|
|
4676
|
-
this.array[index] = element | mask;
|
|
4677
|
-
const added = (element & mask) !== mask;
|
|
4678
|
-
if (added) {
|
|
4679
|
-
this._size++;
|
|
4680
|
-
}
|
|
4681
|
-
return added;
|
|
4682
|
-
}
|
|
4683
|
-
delete(value) {
|
|
4684
|
-
var _a;
|
|
4685
|
-
const [index, mask] = this.getPosition(value);
|
|
4686
|
-
const element = ((_a = this.array[index]) !== null && _a !== void 0 ? _a : 0);
|
|
4687
|
-
this.array[index] = element & ~mask;
|
|
4688
|
-
const deleted = (element & mask) === mask;
|
|
4689
|
-
if (deleted) {
|
|
4690
|
-
this._size--;
|
|
4691
|
-
}
|
|
4692
|
-
return deleted;
|
|
4693
|
-
}
|
|
4694
|
-
clear() {
|
|
4695
|
-
for (let i = this.array.length; i--;) {
|
|
4696
|
-
this.array[i] = 0;
|
|
4697
|
-
}
|
|
4698
|
-
}
|
|
4699
|
-
getPosition(value) {
|
|
4700
|
-
const remainder = value % this.bitsPerElement;
|
|
4701
|
-
const quotient = (value - remainder) / this.bitsPerElement;
|
|
4702
|
-
const index = quotient;
|
|
4703
|
-
const mask = this.getMask(remainder);
|
|
4704
|
-
return [index, mask];
|
|
4705
|
-
}
|
|
4706
|
-
// 输入一定是一个小于bitsPerElement的值, 取值范围是[0, bitsPerElement)
|
|
4707
|
-
getMask(value) {
|
|
4708
|
-
// return 2 ** value
|
|
4709
|
-
return 1 << value;
|
|
4710
|
-
}
|
|
4711
|
-
}
|
|
4712
|
-
|
|
4713
|
-
class TypedBitSet {
|
|
4714
|
-
constructor(array) {
|
|
4715
|
-
this.array = array;
|
|
4716
|
-
this.length = 0;
|
|
4717
|
-
this._size = 0;
|
|
4718
|
-
const bitsPerElement = array.BYTES_PER_ELEMENT * 8;
|
|
4719
|
-
es2018Exports$1.assert(Number.isInteger(bitsPerElement), 'The parameter bitsPerElement must be an integer');
|
|
4720
|
-
es2018Exports$1.assert(bitsPerElement > 0, 'The parameter bitsPerElement must be greater than 0');
|
|
4721
|
-
// `31`是该数据结构中能够处理的最大值
|
|
4722
|
-
es2018Exports$1.assert(bitsPerElement <= 31, 'The mask of bitsPerElement must be less than or equal to 31');
|
|
4723
|
-
this.bitsPerElement = bitsPerElement;
|
|
4724
|
-
}
|
|
4725
|
-
get [Symbol.toStringTag]() {
|
|
4726
|
-
return this.constructor.name;
|
|
4727
|
-
}
|
|
4728
|
-
get size() {
|
|
4729
|
-
return this._size;
|
|
4730
|
-
}
|
|
4731
|
-
[Symbol.iterator]() {
|
|
4732
|
-
return this.values();
|
|
4733
|
-
}
|
|
4734
|
-
*values() {
|
|
4735
|
-
if (this.length > 0) {
|
|
4736
|
-
// maxArrayLength = Math.ceil(this.length / this.bitsPerElement)
|
|
4737
|
-
const maxArrayLength = ~~(this.length / this.bitsPerElement) + 1;
|
|
4738
|
-
for (let index = 0; index < maxArrayLength; index++) {
|
|
4739
|
-
let element = this.array.internalTypedArray[index];
|
|
4740
|
-
let offset = 0;
|
|
4741
|
-
let indexOfBit;
|
|
4742
|
-
while ((indexOfBit = trailingZeros(element)) !== 32) {
|
|
4743
|
-
yield index * this.bitsPerElement + offset + indexOfBit;
|
|
4744
|
-
offset += indexOfBit + 1;
|
|
4745
|
-
element >>= indexOfBit + 1;
|
|
4746
|
-
}
|
|
4747
|
-
}
|
|
4748
|
-
}
|
|
4749
|
-
}
|
|
4750
|
-
_dumpBinaryStrings() {
|
|
4751
|
-
const result = [];
|
|
4752
|
-
for (let i = 0; i < this.array.length; i++) {
|
|
4753
|
-
const binary = this.array.internalTypedArray[i].toString(2);
|
|
4754
|
-
if (binary.length < this.bitsPerElement) {
|
|
4755
|
-
result.push('0'.repeat(this.bitsPerElement - binary.length) + binary);
|
|
4756
|
-
}
|
|
4757
|
-
else {
|
|
4758
|
-
result.push(binary);
|
|
4759
|
-
}
|
|
4760
|
-
}
|
|
4761
|
-
return result;
|
|
4762
|
-
}
|
|
4763
|
-
has(value) {
|
|
4764
|
-
var _a;
|
|
4765
|
-
const [index, mask] = this.getPosition(value);
|
|
4766
|
-
return (((_a = this.array.get(index)) !== null && _a !== void 0 ? _a : 0) & mask) === mask;
|
|
4767
|
-
}
|
|
4768
|
-
add(value) {
|
|
4769
|
-
var _a;
|
|
4770
|
-
es2018Exports$1.assert(value >= 0, 'value must be greater than or equal to 0');
|
|
4771
|
-
if (value >= this.length) {
|
|
4772
|
-
this.length = value + 1;
|
|
4773
|
-
}
|
|
4774
|
-
const [index, mask] = this.getPosition(value);
|
|
4775
|
-
const element = (_a = this.array.get(index)) !== null && _a !== void 0 ? _a : 0;
|
|
4776
|
-
this.array.set(index, element | mask);
|
|
4777
|
-
const added = (element & mask) !== mask;
|
|
4778
|
-
if (added) {
|
|
4779
|
-
this._size++;
|
|
4780
|
-
}
|
|
4781
|
-
return added;
|
|
4782
|
-
}
|
|
4783
|
-
delete(value) {
|
|
4784
|
-
var _a;
|
|
4785
|
-
const [index, mask] = this.getPosition(value);
|
|
4786
|
-
const element = ((_a = this.array.get(index)) !== null && _a !== void 0 ? _a : 0);
|
|
4787
|
-
this.array.set(index, element & ~mask);
|
|
4788
|
-
const deleted = (element & mask) === mask;
|
|
4789
|
-
if (deleted) {
|
|
4790
|
-
this._size--;
|
|
4791
|
-
}
|
|
4792
|
-
return deleted;
|
|
4793
|
-
}
|
|
4794
|
-
clear() {
|
|
4795
|
-
for (let i = this.array.length; i--;) {
|
|
4796
|
-
this.array.set(i, 0);
|
|
4797
|
-
}
|
|
4798
|
-
}
|
|
4799
|
-
getPosition(value) {
|
|
4800
|
-
const remainder = value % this.bitsPerElement;
|
|
4801
|
-
const quotient = (value - remainder) / this.bitsPerElement;
|
|
4802
|
-
const index = quotient;
|
|
4803
|
-
const mask = this.getMask(remainder);
|
|
4804
|
-
return [index, mask];
|
|
4805
|
-
}
|
|
4806
|
-
// 输入一定是一个小于bitsPerElement的值, 取值范围是[0, bitsPerElement)
|
|
4807
|
-
getMask(value) {
|
|
4808
|
-
// return 2 ** value
|
|
4809
|
-
return 1 << value;
|
|
4810
|
-
}
|
|
4811
|
-
}
|
|
4812
|
-
|
|
4813
|
-
export { BitSet, Box, DynamicTypedArray, Emitter, ExpirableMap, HashMap, HashSet, LRUMap, Queue, SortedSet, SparseMap, SparseSet, TLRUMap, TrieMap, TypedBitSet, TypedSparseMap, TypedSparseSet, convertArrayToCons, convertConsToArray, sliceArrayLeft, sliceArrayRight, truncateArrayLeft, truncateArrayRight };
|
|
4814
|
-
//# sourceMappingURL=index.mjs.map
|