@vunk/plus 1.7.3 → 1.7.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.
Files changed (42) hide show
  1. package/components/broadcasting-markdown/index.mjs +101 -238
  2. package/components/broadcasting-markdown/src/ctx.d.ts +1 -4
  3. package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +49 -88
  4. package/components/broadcasting-markdown/src/index.vue.d.ts +44 -103
  5. package/components/broadcasting-markdown/src/types.d.ts +1 -1
  6. package/components/broadcasting-markdown/src/use.d.ts +6 -8
  7. package/components/bubble-templates/index.css +4 -0
  8. package/components/bubble-templates/index.mjs +7 -11412
  9. package/components/metahuman-broadcasting/index.mjs +8 -5
  10. package/components/metahuman-broadcasting/src/index.vue.d.ts +62 -114
  11. package/components/pixi-frame/src/apng.vue.d.ts +3 -3
  12. package/components/pixi-frame/src/bitmap.vue.d.ts +5 -5
  13. package/components/pixi-frame/src/core.vue.d.ts +5 -5
  14. package/components/pixi-frame/src/index.vue.d.ts +12 -12
  15. package/components/pixi-frame/src/video.vue.d.ts +3 -3
  16. package/components/typing-markdown/index.mjs +4 -7
  17. package/components/vditor/src/ctx.d.ts +1 -1
  18. package/components/vditor/src/index.vue.d.ts +1 -1
  19. package/index.css +5 -0
  20. package/package.json +4 -1
  21. package/shared/StreamingInferenceService.mjs +4 -1
  22. package/shared/audioToFrames/index.mjs +2 -5
  23. package/shared/audioToFrames/src/audio/StreamingFeatureExtractorService.d.ts +20 -4
  24. package/shared/audioToFrames/src/audio/index.d.ts +0 -2
  25. package/shared/audioToFrames/src/audio/index.mjs +84 -157
  26. package/shared/audioToFrames/src/core/constants.d.ts +0 -22
  27. package/shared/audioToFrames/src/core/index.mjs +16 -2643
  28. package/shared/audioToFrames/src/core/utils.d.ts +1 -68
  29. package/shared/audioToFrames/src/inference/StreamingInferenceService.d.ts +43 -0
  30. package/shared/audioToFrames/src/media/index.d.ts +0 -5
  31. package/shared/audioToFrames/src/media/index.mjs +180 -610
  32. package/shared/constants.mjs +1 -12
  33. package/shared/PredictiveFrameLoader.mjs +0 -367
  34. package/shared/audioToFrames/src/audio/AudioProcessor.d.ts +0 -25
  35. package/shared/audioToFrames/src/audio/FeatureExtractorService.d.ts +0 -31
  36. package/shared/audioToFrames/src/inference/types.d.ts +0 -102
  37. package/shared/audioToFrames/src/media/ImageBitmapPool.d.ts +0 -63
  38. package/shared/audioToFrames/src/media/ImageProcessor.d.ts +0 -47
  39. package/shared/audioToFrames/src/media/PlaybackService.d.ts +0 -56
  40. package/shared/audioToFrames/src/media/WebGLPlaybackService.d.ts +0 -74
  41. package/shared/audioToFrames/src/media/WebGLRenderer.d.ts +0 -66
  42. package/shared/utils.mjs +0 -123
@@ -1,2651 +1,24 @@
1
- export { B as BATCH_SIZE, C as CHUNK_DURATION_SECONDS, D as DEFAULT_LOW_FREQ, E as ENERGY_FLOOR, F as FRAME_INTERVAL_MS, b as FRAME_LENGTH_MS, c as FRAME_SHIFT_MS, N as NUM_MEL_BINS, a as NUM_SEQUENCE_FRAMES, P as PREEMPH_COEFF, R as REMOVE_DC_OFFSET, e as ROUND_TO_POWER_OF_TWO, S as SAMPLE_RATE, T as TARGET_FPS, W as WINDOW_NUM_CHUNKS, d as WINDOW_NUM_CHUNKS_HALF } from '../../../constants.mjs';
2
- export { P as PerformanceTimer, c as createErrorHandler, i as isNonNull, b as isValidArrayBuffer, a as isValidNumber, m as measurePerformance, n as normalizeError, w as withRetry } from '../../../utils.mjs';
1
+ export { C as CHUNK_DURATION_SECONDS, N as NUM_MEL_BINS, a as NUM_SEQUENCE_FRAMES, W as WINDOW_NUM_CHUNKS, b as WINDOW_NUM_CHUNKS_HALF } from '../../../constants.mjs';
3
2
 
4
- /** Detect free variable `global` from Node.js. */
5
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
6
-
7
- /** Detect free variable `self`. */
8
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
9
-
10
- /** Used as a reference to the global object. */
11
- var root = freeGlobal || freeSelf || Function('return this')();
12
-
13
- var root$1 = root;
14
-
15
- /** Built-in value references. */
16
- var Symbol = root$1.Symbol;
17
-
18
- /** Used for built-in method references. */
19
- var objectProto$c = Object.prototype;
20
-
21
- /** Used to check objects for own properties. */
22
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
23
-
24
- /**
25
- * Used to resolve the
26
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
27
- * of values.
28
- */
29
- var nativeObjectToString$1 = objectProto$c.toString;
30
-
31
- /** Built-in value references. */
32
- var symToStringTag$1 = Symbol ? Symbol.toStringTag : undefined;
33
-
34
- /**
35
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
36
- *
37
- * @private
38
- * @param {*} value The value to query.
39
- * @returns {string} Returns the raw `toStringTag`.
40
- */
41
- function getRawTag(value) {
42
- var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
43
- tag = value[symToStringTag$1];
44
-
45
- try {
46
- value[symToStringTag$1] = undefined;
47
- var unmasked = true;
48
- } catch (e) {}
49
-
50
- var result = nativeObjectToString$1.call(value);
51
- if (unmasked) {
52
- if (isOwn) {
53
- value[symToStringTag$1] = tag;
54
- } else {
55
- delete value[symToStringTag$1];
56
- }
57
- }
58
- return result;
59
- }
60
-
61
- /** Used for built-in method references. */
62
- var objectProto$b = Object.prototype;
63
-
64
- /**
65
- * Used to resolve the
66
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
67
- * of values.
68
- */
69
- var nativeObjectToString = objectProto$b.toString;
70
-
71
- /**
72
- * Converts `value` to a string using `Object.prototype.toString`.
73
- *
74
- * @private
75
- * @param {*} value The value to convert.
76
- * @returns {string} Returns the converted string.
77
- */
78
- function objectToString(value) {
79
- return nativeObjectToString.call(value);
80
- }
81
-
82
- /** `Object#toString` result references. */
83
- var nullTag = '[object Null]',
84
- undefinedTag = '[object Undefined]';
85
-
86
- /** Built-in value references. */
87
- var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
88
-
89
- /**
90
- * The base implementation of `getTag` without fallbacks for buggy environments.
91
- *
92
- * @private
93
- * @param {*} value The value to query.
94
- * @returns {string} Returns the `toStringTag`.
95
- */
96
- function baseGetTag(value) {
97
- if (value == null) {
98
- return value === undefined ? undefinedTag : nullTag;
99
- }
100
- return (symToStringTag && symToStringTag in Object(value))
101
- ? getRawTag(value)
102
- : objectToString(value);
103
- }
104
-
105
- /**
106
- * Checks if `value` is object-like. A value is object-like if it's not `null`
107
- * and has a `typeof` result of "object".
108
- *
109
- * @static
110
- * @memberOf _
111
- * @since 4.0.0
112
- * @category Lang
113
- * @param {*} value The value to check.
114
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
115
- * @example
116
- *
117
- * _.isObjectLike({});
118
- * // => true
119
- *
120
- * _.isObjectLike([1, 2, 3]);
121
- * // => true
122
- *
123
- * _.isObjectLike(_.noop);
124
- * // => false
125
- *
126
- * _.isObjectLike(null);
127
- * // => false
128
- */
129
- function isObjectLike(value) {
130
- return value != null && typeof value == 'object';
131
- }
132
-
133
- /** `Object#toString` result references. */
134
- var symbolTag$2 = '[object Symbol]';
135
-
136
- /**
137
- * Checks if `value` is classified as a `Symbol` primitive or object.
138
- *
139
- * @static
140
- * @memberOf _
141
- * @since 4.0.0
142
- * @category Lang
143
- * @param {*} value The value to check.
144
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
145
- * @example
146
- *
147
- * _.isSymbol(Symbol.iterator);
148
- * // => true
149
- *
150
- * _.isSymbol('abc');
151
- * // => false
152
- */
153
- function isSymbol(value) {
154
- return typeof value == 'symbol' ||
155
- (isObjectLike(value) && baseGetTag(value) == symbolTag$2);
156
- }
157
-
158
- /**
159
- * Checks if `value` is classified as an `Array` object.
160
- *
161
- * @static
162
- * @memberOf _
163
- * @since 0.1.0
164
- * @category Lang
165
- * @param {*} value The value to check.
166
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
167
- * @example
168
- *
169
- * _.isArray([1, 2, 3]);
170
- * // => true
171
- *
172
- * _.isArray(document.body.children);
173
- * // => false
174
- *
175
- * _.isArray('abc');
176
- * // => false
177
- *
178
- * _.isArray(_.noop);
179
- * // => false
180
- */
181
- var isArray = Array.isArray;
182
-
183
- /** Used to match a single whitespace character. */
184
- var reWhitespace = /\s/;
185
-
186
- /**
187
- * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
188
- * character of `string`.
189
- *
190
- * @private
191
- * @param {string} string The string to inspect.
192
- * @returns {number} Returns the index of the last non-whitespace character.
193
- */
194
- function trimmedEndIndex(string) {
195
- var index = string.length;
196
-
197
- while (index-- && reWhitespace.test(string.charAt(index))) {}
198
- return index;
199
- }
200
-
201
- /** Used to match leading whitespace. */
202
- var reTrimStart = /^\s+/;
203
-
204
- /**
205
- * The base implementation of `_.trim`.
206
- *
207
- * @private
208
- * @param {string} string The string to trim.
209
- * @returns {string} Returns the trimmed string.
210
- */
211
- function baseTrim(string) {
212
- return string
213
- ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
214
- : string;
215
- }
216
-
217
- /**
218
- * Checks if `value` is the
219
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
220
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
221
- *
222
- * @static
223
- * @memberOf _
224
- * @since 0.1.0
225
- * @category Lang
226
- * @param {*} value The value to check.
227
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
228
- * @example
229
- *
230
- * _.isObject({});
231
- * // => true
232
- *
233
- * _.isObject([1, 2, 3]);
234
- * // => true
235
- *
236
- * _.isObject(_.noop);
237
- * // => true
238
- *
239
- * _.isObject(null);
240
- * // => false
241
- */
242
- function isObject(value) {
243
- var type = typeof value;
244
- return value != null && (type == 'object' || type == 'function');
245
- }
246
-
247
- /** Used as references for various `Number` constants. */
248
- var NAN = 0 / 0;
249
-
250
- /** Used to detect bad signed hexadecimal string values. */
251
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
252
-
253
- /** Used to detect binary string values. */
254
- var reIsBinary = /^0b[01]+$/i;
255
-
256
- /** Used to detect octal string values. */
257
- var reIsOctal = /^0o[0-7]+$/i;
258
-
259
- /** Built-in method references without a dependency on `root`. */
260
- var freeParseInt = parseInt;
261
-
262
- /**
263
- * Converts `value` to a number.
264
- *
265
- * @static
266
- * @memberOf _
267
- * @since 4.0.0
268
- * @category Lang
269
- * @param {*} value The value to process.
270
- * @returns {number} Returns the number.
271
- * @example
272
- *
273
- * _.toNumber(3.2);
274
- * // => 3.2
275
- *
276
- * _.toNumber(Number.MIN_VALUE);
277
- * // => 5e-324
278
- *
279
- * _.toNumber(Infinity);
280
- * // => Infinity
281
- *
282
- * _.toNumber('3.2');
283
- * // => 3.2
284
- */
285
- function toNumber(value) {
286
- if (typeof value == 'number') {
287
- return value;
288
- }
289
- if (isSymbol(value)) {
290
- return NAN;
291
- }
292
- if (isObject(value)) {
293
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
294
- value = isObject(other) ? (other + '') : other;
295
- }
296
- if (typeof value != 'string') {
297
- return value === 0 ? value : +value;
298
- }
299
- value = baseTrim(value);
300
- var isBinary = reIsBinary.test(value);
301
- return (isBinary || reIsOctal.test(value))
302
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
303
- : (reIsBadHex.test(value) ? NAN : +value);
304
- }
305
-
306
- /** `Object#toString` result references. */
307
- var asyncTag = '[object AsyncFunction]',
308
- funcTag$2 = '[object Function]',
309
- genTag$1 = '[object GeneratorFunction]',
310
- proxyTag = '[object Proxy]';
311
-
312
- /**
313
- * Checks if `value` is classified as a `Function` object.
314
- *
315
- * @static
316
- * @memberOf _
317
- * @since 0.1.0
318
- * @category Lang
319
- * @param {*} value The value to check.
320
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
321
- * @example
322
- *
323
- * _.isFunction(_);
324
- * // => true
325
- *
326
- * _.isFunction(/abc/);
327
- * // => false
328
- */
329
- function isFunction(value) {
330
- if (!isObject(value)) {
331
- return false;
332
- }
333
- // The use of `Object#toString` avoids issues with the `typeof` operator
334
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
335
- var tag = baseGetTag(value);
336
- return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
337
- }
338
-
339
- /** Used to detect overreaching core-js shims. */
340
- var coreJsData = root$1['__core-js_shared__'];
341
-
342
- /** Used to detect methods masquerading as native. */
343
- var maskSrcKey = (function() {
344
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
345
- return uid ? ('Symbol(src)_1.' + uid) : '';
346
- }());
347
-
348
- /**
349
- * Checks if `func` has its source masked.
350
- *
351
- * @private
352
- * @param {Function} func The function to check.
353
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
354
- */
355
- function isMasked(func) {
356
- return !!maskSrcKey && (maskSrcKey in func);
357
- }
358
-
359
- /** Used for built-in method references. */
360
- var funcProto$1 = Function.prototype;
361
-
362
- /** Used to resolve the decompiled source of functions. */
363
- var funcToString$1 = funcProto$1.toString;
364
-
365
- /**
366
- * Converts `func` to its source code.
367
- *
368
- * @private
369
- * @param {Function} func The function to convert.
370
- * @returns {string} Returns the source code.
371
- */
372
- function toSource(func) {
373
- if (func != null) {
374
- try {
375
- return funcToString$1.call(func);
376
- } catch (e) {}
377
- try {
378
- return (func + '');
379
- } catch (e) {}
380
- }
381
- return '';
382
- }
383
-
384
- /**
385
- * Used to match `RegExp`
386
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
387
- */
388
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
389
-
390
- /** Used to detect host constructors (Safari). */
391
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
392
-
393
- /** Used for built-in method references. */
394
- var funcProto = Function.prototype,
395
- objectProto$a = Object.prototype;
396
-
397
- /** Used to resolve the decompiled source of functions. */
398
- var funcToString = funcProto.toString;
399
-
400
- /** Used to check objects for own properties. */
401
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
402
-
403
- /** Used to detect if a method is native. */
404
- var reIsNative = RegExp('^' +
405
- funcToString.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&')
406
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
407
- );
408
-
409
- /**
410
- * The base implementation of `_.isNative` without bad shim checks.
411
- *
412
- * @private
413
- * @param {*} value The value to check.
414
- * @returns {boolean} Returns `true` if `value` is a native function,
415
- * else `false`.
416
- */
417
- function baseIsNative(value) {
418
- if (!isObject(value) || isMasked(value)) {
419
- return false;
420
- }
421
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
422
- return pattern.test(toSource(value));
423
- }
424
-
425
- /**
426
- * Gets the value at `key` of `object`.
427
- *
428
- * @private
429
- * @param {Object} [object] The object to query.
430
- * @param {string} key The key of the property to get.
431
- * @returns {*} Returns the property value.
432
- */
433
- function getValue(object, key) {
434
- return object == null ? undefined : object[key];
435
- }
436
-
437
- /**
438
- * Gets the native function at `key` of `object`.
439
- *
440
- * @private
441
- * @param {Object} object The object to query.
442
- * @param {string} key The key of the method to get.
443
- * @returns {*} Returns the function if it's native, else `undefined`.
444
- */
445
- function getNative(object, key) {
446
- var value = getValue(object, key);
447
- return baseIsNative(value) ? value : undefined;
448
- }
449
-
450
- /* Built-in method references that are verified to be native. */
451
- var WeakMap = getNative(root$1, 'WeakMap');
452
-
453
- /** Built-in value references. */
454
- var objectCreate = Object.create;
455
-
456
- /**
457
- * The base implementation of `_.create` without support for assigning
458
- * properties to the created object.
459
- *
460
- * @private
461
- * @param {Object} proto The object to inherit from.
462
- * @returns {Object} Returns the new object.
463
- */
464
- var baseCreate = (function() {
465
- function object() {}
466
- return function(proto) {
467
- if (!isObject(proto)) {
468
- return {};
469
- }
470
- if (objectCreate) {
471
- return objectCreate(proto);
472
- }
473
- object.prototype = proto;
474
- var result = new object;
475
- object.prototype = undefined;
476
- return result;
477
- };
478
- }());
479
-
480
- /**
481
- * Copies the values of `source` to `array`.
482
- *
483
- * @private
484
- * @param {Array} source The array to copy values from.
485
- * @param {Array} [array=[]] The array to copy values to.
486
- * @returns {Array} Returns `array`.
487
- */
488
- function copyArray(source, array) {
489
- var index = -1,
490
- length = source.length;
491
-
492
- array || (array = Array(length));
493
- while (++index < length) {
494
- array[index] = source[index];
495
- }
496
- return array;
497
- }
498
-
499
- var defineProperty = (function() {
500
- try {
501
- var func = getNative(Object, 'defineProperty');
502
- func({}, '', {});
503
- return func;
504
- } catch (e) {}
505
- }());
506
-
507
- /**
508
- * A specialized version of `_.forEach` for arrays without support for
509
- * iteratee shorthands.
510
- *
511
- * @private
512
- * @param {Array} [array] The array to iterate over.
513
- * @param {Function} iteratee The function invoked per iteration.
514
- * @returns {Array} Returns `array`.
515
- */
516
- function arrayEach(array, iteratee) {
517
- var index = -1,
518
- length = array == null ? 0 : array.length;
519
-
520
- while (++index < length) {
521
- if (iteratee(array[index], index, array) === false) {
522
- break;
523
- }
524
- }
525
- return array;
526
- }
527
-
528
- /** Used as references for various `Number` constants. */
529
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
530
-
531
- /** Used to detect unsigned integer values. */
532
- var reIsUint = /^(?:0|[1-9]\d*)$/;
533
-
534
- /**
535
- * Checks if `value` is a valid array-like index.
536
- *
537
- * @private
538
- * @param {*} value The value to check.
539
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
540
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
541
- */
542
- function isIndex(value, length) {
543
- var type = typeof value;
544
- length = length == null ? MAX_SAFE_INTEGER$1 : length;
545
-
546
- return !!length &&
547
- (type == 'number' ||
548
- (type != 'symbol' && reIsUint.test(value))) &&
549
- (value > -1 && value % 1 == 0 && value < length);
550
- }
551
-
552
- /**
553
- * The base implementation of `assignValue` and `assignMergeValue` without
554
- * value checks.
555
- *
556
- * @private
557
- * @param {Object} object The object to modify.
558
- * @param {string} key The key of the property to assign.
559
- * @param {*} value The value to assign.
560
- */
561
- function baseAssignValue(object, key, value) {
562
- if (key == '__proto__' && defineProperty) {
563
- defineProperty(object, key, {
564
- 'configurable': true,
565
- 'enumerable': true,
566
- 'value': value,
567
- 'writable': true
568
- });
569
- } else {
570
- object[key] = value;
571
- }
572
- }
573
-
574
- /**
575
- * Performs a
576
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
577
- * comparison between two values to determine if they are equivalent.
578
- *
579
- * @static
580
- * @memberOf _
581
- * @since 4.0.0
582
- * @category Lang
583
- * @param {*} value The value to compare.
584
- * @param {*} other The other value to compare.
585
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
586
- * @example
587
- *
588
- * var object = { 'a': 1 };
589
- * var other = { 'a': 1 };
590
- *
591
- * _.eq(object, object);
592
- * // => true
593
- *
594
- * _.eq(object, other);
595
- * // => false
596
- *
597
- * _.eq('a', 'a');
598
- * // => true
599
- *
600
- * _.eq('a', Object('a'));
601
- * // => false
602
- *
603
- * _.eq(NaN, NaN);
604
- * // => true
605
- */
606
- function eq(value, other) {
607
- return value === other || (value !== value && other !== other);
608
- }
609
-
610
- /** Used for built-in method references. */
611
- var objectProto$9 = Object.prototype;
612
-
613
- /** Used to check objects for own properties. */
614
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
615
-
616
- /**
617
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
618
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
619
- * for equality comparisons.
620
- *
621
- * @private
622
- * @param {Object} object The object to modify.
623
- * @param {string} key The key of the property to assign.
624
- * @param {*} value The value to assign.
625
- */
626
- function assignValue(object, key, value) {
627
- var objValue = object[key];
628
- if (!(hasOwnProperty$7.call(object, key) && eq(objValue, value)) ||
629
- (value === undefined && !(key in object))) {
630
- baseAssignValue(object, key, value);
631
- }
632
- }
633
-
634
- /**
635
- * Copies properties of `source` to `object`.
636
- *
637
- * @private
638
- * @param {Object} source The object to copy properties from.
639
- * @param {Array} props The property identifiers to copy.
640
- * @param {Object} [object={}] The object to copy properties to.
641
- * @param {Function} [customizer] The function to customize copied values.
642
- * @returns {Object} Returns `object`.
643
- */
644
- function copyObject(source, props, object, customizer) {
645
- var isNew = !object;
646
- object || (object = {});
647
-
648
- var index = -1,
649
- length = props.length;
650
-
651
- while (++index < length) {
652
- var key = props[index];
653
-
654
- var newValue = undefined;
655
-
656
- if (newValue === undefined) {
657
- newValue = source[key];
658
- }
659
- if (isNew) {
660
- baseAssignValue(object, key, newValue);
661
- } else {
662
- assignValue(object, key, newValue);
663
- }
664
- }
665
- return object;
666
- }
667
-
668
- /** Used as references for various `Number` constants. */
669
- var MAX_SAFE_INTEGER = 9007199254740991;
670
-
671
- /**
672
- * Checks if `value` is a valid array-like length.
673
- *
674
- * **Note:** This method is loosely based on
675
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
676
- *
677
- * @static
678
- * @memberOf _
679
- * @since 4.0.0
680
- * @category Lang
681
- * @param {*} value The value to check.
682
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
683
- * @example
684
- *
685
- * _.isLength(3);
686
- * // => true
687
- *
688
- * _.isLength(Number.MIN_VALUE);
689
- * // => false
690
- *
691
- * _.isLength(Infinity);
692
- * // => false
693
- *
694
- * _.isLength('3');
695
- * // => false
696
- */
697
- function isLength(value) {
698
- return typeof value == 'number' &&
699
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
700
- }
701
-
702
- /**
703
- * Checks if `value` is array-like. A value is considered array-like if it's
704
- * not a function and has a `value.length` that's an integer greater than or
705
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
706
- *
707
- * @static
708
- * @memberOf _
709
- * @since 4.0.0
710
- * @category Lang
711
- * @param {*} value The value to check.
712
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
713
- * @example
714
- *
715
- * _.isArrayLike([1, 2, 3]);
716
- * // => true
717
- *
718
- * _.isArrayLike(document.body.children);
719
- * // => true
720
- *
721
- * _.isArrayLike('abc');
722
- * // => true
723
- *
724
- * _.isArrayLike(_.noop);
725
- * // => false
726
- */
727
- function isArrayLike(value) {
728
- return value != null && isLength(value.length) && !isFunction(value);
729
- }
730
-
731
- /** Used for built-in method references. */
732
- var objectProto$8 = Object.prototype;
733
-
734
- /**
735
- * Checks if `value` is likely a prototype object.
736
- *
737
- * @private
738
- * @param {*} value The value to check.
739
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
740
- */
741
- function isPrototype(value) {
742
- var Ctor = value && value.constructor,
743
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$8;
744
-
745
- return value === proto;
746
- }
747
-
748
- /**
749
- * The base implementation of `_.times` without support for iteratee shorthands
750
- * or max array length checks.
751
- *
752
- * @private
753
- * @param {number} n The number of times to invoke `iteratee`.
754
- * @param {Function} iteratee The function invoked per iteration.
755
- * @returns {Array} Returns the array of results.
756
- */
757
- function baseTimes(n, iteratee) {
758
- var index = -1,
759
- result = Array(n);
760
-
761
- while (++index < n) {
762
- result[index] = iteratee(index);
763
- }
764
- return result;
765
- }
766
-
767
- /** `Object#toString` result references. */
768
- var argsTag$2 = '[object Arguments]';
769
-
770
- /**
771
- * The base implementation of `_.isArguments`.
772
- *
773
- * @private
774
- * @param {*} value The value to check.
775
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
776
- */
777
- function baseIsArguments(value) {
778
- return isObjectLike(value) && baseGetTag(value) == argsTag$2;
779
- }
780
-
781
- /** Used for built-in method references. */
782
- var objectProto$7 = Object.prototype;
783
-
784
- /** Used to check objects for own properties. */
785
- var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
786
-
787
- /** Built-in value references. */
788
- var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
789
-
790
- /**
791
- * Checks if `value` is likely an `arguments` object.
792
- *
793
- * @static
794
- * @memberOf _
795
- * @since 0.1.0
796
- * @category Lang
797
- * @param {*} value The value to check.
798
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
799
- * else `false`.
800
- * @example
801
- *
802
- * _.isArguments(function() { return arguments; }());
803
- * // => true
804
- *
805
- * _.isArguments([1, 2, 3]);
806
- * // => false
807
- */
808
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
809
- return isObjectLike(value) && hasOwnProperty$6.call(value, 'callee') &&
810
- !propertyIsEnumerable$1.call(value, 'callee');
811
- };
812
-
813
- /**
814
- * This method returns `false`.
815
- *
816
- * @static
817
- * @memberOf _
818
- * @since 4.13.0
819
- * @category Util
820
- * @returns {boolean} Returns `false`.
821
- * @example
822
- *
823
- * _.times(2, _.stubFalse);
824
- * // => [false, false]
825
- */
826
- function stubFalse() {
827
- return false;
828
- }
829
-
830
- /** Detect free variable `exports`. */
831
- var freeExports$2 = typeof exports == 'object' && exports && !exports.nodeType && exports;
832
-
833
- /** Detect free variable `module`. */
834
- var freeModule$2 = freeExports$2 && typeof module == 'object' && module && !module.nodeType && module;
835
-
836
- /** Detect the popular CommonJS extension `module.exports`. */
837
- var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
838
-
839
- /** Built-in value references. */
840
- var Buffer$1 = moduleExports$2 ? root$1.Buffer : undefined;
841
-
842
- /* Built-in method references for those with the same name as other `lodash` methods. */
843
- var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : undefined;
844
-
845
- /**
846
- * Checks if `value` is a buffer.
847
- *
848
- * @static
849
- * @memberOf _
850
- * @since 4.3.0
851
- * @category Lang
852
- * @param {*} value The value to check.
853
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
854
- * @example
855
- *
856
- * _.isBuffer(new Buffer(2));
857
- * // => true
858
- *
859
- * _.isBuffer(new Uint8Array(2));
860
- * // => false
861
- */
862
- var isBuffer = nativeIsBuffer || stubFalse;
863
-
864
- /** `Object#toString` result references. */
865
- var argsTag$1 = '[object Arguments]',
866
- arrayTag$1 = '[object Array]',
867
- boolTag$2 = '[object Boolean]',
868
- dateTag$2 = '[object Date]',
869
- errorTag$1 = '[object Error]',
870
- funcTag$1 = '[object Function]',
871
- mapTag$4 = '[object Map]',
872
- numberTag$2 = '[object Number]',
873
- objectTag$2 = '[object Object]',
874
- regexpTag$2 = '[object RegExp]',
875
- setTag$4 = '[object Set]',
876
- stringTag$2 = '[object String]',
877
- weakMapTag$2 = '[object WeakMap]';
878
-
879
- var arrayBufferTag$2 = '[object ArrayBuffer]',
880
- dataViewTag$3 = '[object DataView]',
881
- float32Tag$2 = '[object Float32Array]',
882
- float64Tag$2 = '[object Float64Array]',
883
- int8Tag$2 = '[object Int8Array]',
884
- int16Tag$2 = '[object Int16Array]',
885
- int32Tag$2 = '[object Int32Array]',
886
- uint8Tag$2 = '[object Uint8Array]',
887
- uint8ClampedTag$2 = '[object Uint8ClampedArray]',
888
- uint16Tag$2 = '[object Uint16Array]',
889
- uint32Tag$2 = '[object Uint32Array]';
890
-
891
- /** Used to identify `toStringTag` values of typed arrays. */
892
- var typedArrayTags = {};
893
- typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
894
- typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
895
- typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
896
- typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
897
- typedArrayTags[uint32Tag$2] = true;
898
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
899
- typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
900
- typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
901
- typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
902
- typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
903
- typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] =
904
- typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
905
- typedArrayTags[weakMapTag$2] = false;
906
-
907
- /**
908
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
909
- *
910
- * @private
911
- * @param {*} value The value to check.
912
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
913
- */
914
- function baseIsTypedArray(value) {
915
- return isObjectLike(value) &&
916
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
917
- }
918
-
919
- /**
920
- * The base implementation of `_.unary` without support for storing metadata.
921
- *
922
- * @private
923
- * @param {Function} func The function to cap arguments for.
924
- * @returns {Function} Returns the new capped function.
925
- */
926
- function baseUnary(func) {
927
- return function(value) {
928
- return func(value);
929
- };
930
- }
931
-
932
- /** Detect free variable `exports`. */
933
- var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;
934
-
935
- /** Detect free variable `module`. */
936
- var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;
937
-
938
- /** Detect the popular CommonJS extension `module.exports`. */
939
- var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
940
-
941
- /** Detect free variable `process` from Node.js. */
942
- var freeProcess = moduleExports$1 && freeGlobal.process;
943
-
944
- /** Used to access faster Node.js helpers. */
945
- var nodeUtil = (function() {
946
- try {
947
- // Use `util.types` for Node.js 10+.
948
- var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;
949
-
950
- if (types) {
951
- return types;
952
- }
953
-
954
- // Legacy `process.binding('util')` for Node.js < 10.
955
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
956
- } catch (e) {}
957
- }());
958
-
959
- /* Node.js helper references. */
960
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
961
-
962
- /**
963
- * Checks if `value` is classified as a typed array.
964
- *
965
- * @static
966
- * @memberOf _
967
- * @since 3.0.0
968
- * @category Lang
969
- * @param {*} value The value to check.
970
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
971
- * @example
972
- *
973
- * _.isTypedArray(new Uint8Array);
974
- * // => true
975
- *
976
- * _.isTypedArray([]);
977
- * // => false
978
- */
979
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
980
-
981
- /** Used for built-in method references. */
982
- var objectProto$6 = Object.prototype;
983
-
984
- /** Used to check objects for own properties. */
985
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
986
-
987
- /**
988
- * Creates an array of the enumerable property names of the array-like `value`.
989
- *
990
- * @private
991
- * @param {*} value The value to query.
992
- * @param {boolean} inherited Specify returning inherited property names.
993
- * @returns {Array} Returns the array of property names.
994
- */
995
- function arrayLikeKeys(value, inherited) {
996
- var isArr = isArray(value),
997
- isArg = !isArr && isArguments(value),
998
- isBuff = !isArr && !isArg && isBuffer(value),
999
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
1000
- skipIndexes = isArr || isArg || isBuff || isType,
1001
- result = skipIndexes ? baseTimes(value.length, String) : [],
1002
- length = result.length;
1003
-
1004
- for (var key in value) {
1005
- if ((inherited || hasOwnProperty$5.call(value, key)) &&
1006
- !(skipIndexes && (
1007
- // Safari 9 has enumerable `arguments.length` in strict mode.
1008
- key == 'length' ||
1009
- // Node.js 0.10 has enumerable non-index properties on buffers.
1010
- (isBuff && (key == 'offset' || key == 'parent')) ||
1011
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
1012
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1013
- // Skip index properties.
1014
- isIndex(key, length)
1015
- ))) {
1016
- result.push(key);
1017
- }
1018
- }
1019
- return result;
1020
- }
1021
-
1022
- /**
1023
- * Creates a unary function that invokes `func` with its argument transformed.
1024
- *
1025
- * @private
1026
- * @param {Function} func The function to wrap.
1027
- * @param {Function} transform The argument transform.
1028
- * @returns {Function} Returns the new function.
1029
- */
1030
- function overArg(func, transform) {
1031
- return function(arg) {
1032
- return func(transform(arg));
1033
- };
1034
- }
1035
-
1036
- /* Built-in method references for those with the same name as other `lodash` methods. */
1037
- var nativeKeys = overArg(Object.keys, Object);
1038
-
1039
- /** Used for built-in method references. */
1040
- var objectProto$5 = Object.prototype;
1041
-
1042
- /** Used to check objects for own properties. */
1043
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
1044
-
1045
- /**
1046
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1047
- *
1048
- * @private
1049
- * @param {Object} object The object to query.
1050
- * @returns {Array} Returns the array of property names.
1051
- */
1052
- function baseKeys(object) {
1053
- if (!isPrototype(object)) {
1054
- return nativeKeys(object);
1055
- }
1056
- var result = [];
1057
- for (var key in Object(object)) {
1058
- if (hasOwnProperty$4.call(object, key) && key != 'constructor') {
1059
- result.push(key);
1060
- }
1061
- }
1062
- return result;
1063
- }
1064
-
1065
- /**
1066
- * Creates an array of the own enumerable property names of `object`.
1067
- *
1068
- * **Note:** Non-object values are coerced to objects. See the
1069
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1070
- * for more details.
1071
- *
1072
- * @static
1073
- * @since 0.1.0
1074
- * @memberOf _
1075
- * @category Object
1076
- * @param {Object} object The object to query.
1077
- * @returns {Array} Returns the array of property names.
1078
- * @example
1079
- *
1080
- * function Foo() {
1081
- * this.a = 1;
1082
- * this.b = 2;
1083
- * }
1084
- *
1085
- * Foo.prototype.c = 3;
1086
- *
1087
- * _.keys(new Foo);
1088
- * // => ['a', 'b'] (iteration order is not guaranteed)
1089
- *
1090
- * _.keys('hi');
1091
- * // => ['0', '1']
1092
- */
1093
- function keys(object) {
1094
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1095
- }
1096
-
1097
- /**
1098
- * This function is like
1099
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1100
- * except that it includes inherited enumerable properties.
1101
- *
1102
- * @private
1103
- * @param {Object} object The object to query.
1104
- * @returns {Array} Returns the array of property names.
1105
- */
1106
- function nativeKeysIn(object) {
1107
- var result = [];
1108
- if (object != null) {
1109
- for (var key in Object(object)) {
1110
- result.push(key);
1111
- }
1112
- }
1113
- return result;
1114
- }
1115
-
1116
- /** Used for built-in method references. */
1117
- var objectProto$4 = Object.prototype;
1118
-
1119
- /** Used to check objects for own properties. */
1120
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1121
-
1122
- /**
1123
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
1124
- *
1125
- * @private
1126
- * @param {Object} object The object to query.
1127
- * @returns {Array} Returns the array of property names.
1128
- */
1129
- function baseKeysIn(object) {
1130
- if (!isObject(object)) {
1131
- return nativeKeysIn(object);
1132
- }
1133
- var isProto = isPrototype(object),
1134
- result = [];
1135
-
1136
- for (var key in object) {
1137
- if (!(key == 'constructor' && (isProto || !hasOwnProperty$3.call(object, key)))) {
1138
- result.push(key);
1139
- }
1140
- }
1141
- return result;
1142
- }
1143
-
1144
- /**
1145
- * Creates an array of the own and inherited enumerable property names of `object`.
1146
- *
1147
- * **Note:** Non-object values are coerced to objects.
1148
- *
1149
- * @static
1150
- * @memberOf _
1151
- * @since 3.0.0
1152
- * @category Object
1153
- * @param {Object} object The object to query.
1154
- * @returns {Array} Returns the array of property names.
1155
- * @example
1156
- *
1157
- * function Foo() {
1158
- * this.a = 1;
1159
- * this.b = 2;
1160
- * }
1161
- *
1162
- * Foo.prototype.c = 3;
1163
- *
1164
- * _.keysIn(new Foo);
1165
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
1166
- */
1167
- function keysIn(object) {
1168
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
1169
- }
1170
-
1171
- /* Built-in method references that are verified to be native. */
1172
- var nativeCreate = getNative(Object, 'create');
1173
-
1174
- /**
1175
- * Removes all key-value entries from the hash.
1176
- *
1177
- * @private
1178
- * @name clear
1179
- * @memberOf Hash
1180
- */
1181
- function hashClear() {
1182
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
1183
- this.size = 0;
1184
- }
1185
-
1186
- /**
1187
- * Removes `key` and its value from the hash.
1188
- *
1189
- * @private
1190
- * @name delete
1191
- * @memberOf Hash
1192
- * @param {Object} hash The hash to modify.
1193
- * @param {string} key The key of the value to remove.
1194
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1195
- */
1196
- function hashDelete(key) {
1197
- var result = this.has(key) && delete this.__data__[key];
1198
- this.size -= result ? 1 : 0;
1199
- return result;
1200
- }
1201
-
1202
- /** Used to stand-in for `undefined` hash values. */
1203
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1204
-
1205
- /** Used for built-in method references. */
1206
- var objectProto$3 = Object.prototype;
1207
-
1208
- /** Used to check objects for own properties. */
1209
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
1210
-
1211
- /**
1212
- * Gets the hash value for `key`.
1213
- *
1214
- * @private
1215
- * @name get
1216
- * @memberOf Hash
1217
- * @param {string} key The key of the value to get.
1218
- * @returns {*} Returns the entry value.
1219
- */
1220
- function hashGet(key) {
1221
- var data = this.__data__;
1222
- if (nativeCreate) {
1223
- var result = data[key];
1224
- return result === HASH_UNDEFINED$1 ? undefined : result;
1225
- }
1226
- return hasOwnProperty$2.call(data, key) ? data[key] : undefined;
1227
- }
1228
-
1229
- /** Used for built-in method references. */
1230
- var objectProto$2 = Object.prototype;
1231
-
1232
- /** Used to check objects for own properties. */
1233
- var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
1234
-
1235
- /**
1236
- * Checks if a hash value for `key` exists.
1237
- *
1238
- * @private
1239
- * @name has
1240
- * @memberOf Hash
1241
- * @param {string} key The key of the entry to check.
1242
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1243
- */
1244
- function hashHas(key) {
1245
- var data = this.__data__;
1246
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty$1.call(data, key);
1247
- }
1248
-
1249
- /** Used to stand-in for `undefined` hash values. */
1250
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1251
-
1252
- /**
1253
- * Sets the hash `key` to `value`.
1254
- *
1255
- * @private
1256
- * @name set
1257
- * @memberOf Hash
1258
- * @param {string} key The key of the value to set.
1259
- * @param {*} value The value to set.
1260
- * @returns {Object} Returns the hash instance.
1261
- */
1262
- function hashSet(key, value) {
1263
- var data = this.__data__;
1264
- this.size += this.has(key) ? 0 : 1;
1265
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
1266
- return this;
1267
- }
1268
-
1269
- /**
1270
- * Creates a hash object.
1271
- *
1272
- * @private
1273
- * @constructor
1274
- * @param {Array} [entries] The key-value pairs to cache.
1275
- */
1276
- function Hash(entries) {
1277
- var index = -1,
1278
- length = entries == null ? 0 : entries.length;
1279
-
1280
- this.clear();
1281
- while (++index < length) {
1282
- var entry = entries[index];
1283
- this.set(entry[0], entry[1]);
1284
- }
1285
- }
1286
-
1287
- // Add methods to `Hash`.
1288
- Hash.prototype.clear = hashClear;
1289
- Hash.prototype['delete'] = hashDelete;
1290
- Hash.prototype.get = hashGet;
1291
- Hash.prototype.has = hashHas;
1292
- Hash.prototype.set = hashSet;
1293
-
1294
- /**
1295
- * Removes all key-value entries from the list cache.
1296
- *
1297
- * @private
1298
- * @name clear
1299
- * @memberOf ListCache
1300
- */
1301
- function listCacheClear() {
1302
- this.__data__ = [];
1303
- this.size = 0;
1304
- }
1305
-
1306
- /**
1307
- * Gets the index at which the `key` is found in `array` of key-value pairs.
1308
- *
1309
- * @private
1310
- * @param {Array} array The array to inspect.
1311
- * @param {*} key The key to search for.
1312
- * @returns {number} Returns the index of the matched value, else `-1`.
1313
- */
1314
- function assocIndexOf(array, key) {
1315
- var length = array.length;
1316
- while (length--) {
1317
- if (eq(array[length][0], key)) {
1318
- return length;
1319
- }
1320
- }
1321
- return -1;
1322
- }
1323
-
1324
- /** Used for built-in method references. */
1325
- var arrayProto = Array.prototype;
1326
-
1327
- /** Built-in value references. */
1328
- var splice = arrayProto.splice;
1329
-
1330
- /**
1331
- * Removes `key` and its value from the list cache.
1332
- *
1333
- * @private
1334
- * @name delete
1335
- * @memberOf ListCache
1336
- * @param {string} key The key of the value to remove.
1337
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1338
- */
1339
- function listCacheDelete(key) {
1340
- var data = this.__data__,
1341
- index = assocIndexOf(data, key);
1342
-
1343
- if (index < 0) {
1344
- return false;
3
+ function normalizeError(error) {
4
+ if (error instanceof Error) {
5
+ return error.message;
1345
6
  }
1346
- var lastIndex = data.length - 1;
1347
- if (index == lastIndex) {
1348
- data.pop();
1349
- } else {
1350
- splice.call(data, index, 1);
7
+ if (typeof error === "string") {
8
+ return error;
1351
9
  }
1352
- --this.size;
1353
- return true;
10
+ return "Unknown error occurred";
1354
11
  }
1355
-
1356
- /**
1357
- * Gets the list cache value for `key`.
1358
- *
1359
- * @private
1360
- * @name get
1361
- * @memberOf ListCache
1362
- * @param {string} key The key of the value to get.
1363
- * @returns {*} Returns the entry value.
1364
- */
1365
- function listCacheGet(key) {
1366
- var data = this.__data__,
1367
- index = assocIndexOf(data, key);
1368
-
1369
- return index < 0 ? undefined : data[index][1];
1370
- }
1371
-
1372
- /**
1373
- * Checks if a list cache value for `key` exists.
1374
- *
1375
- * @private
1376
- * @name has
1377
- * @memberOf ListCache
1378
- * @param {string} key The key of the entry to check.
1379
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1380
- */
1381
- function listCacheHas(key) {
1382
- return assocIndexOf(this.__data__, key) > -1;
1383
- }
1384
-
1385
- /**
1386
- * Sets the list cache `key` to `value`.
1387
- *
1388
- * @private
1389
- * @name set
1390
- * @memberOf ListCache
1391
- * @param {string} key The key of the value to set.
1392
- * @param {*} value The value to set.
1393
- * @returns {Object} Returns the list cache instance.
1394
- */
1395
- function listCacheSet(key, value) {
1396
- var data = this.__data__,
1397
- index = assocIndexOf(data, key);
1398
-
1399
- if (index < 0) {
1400
- ++this.size;
1401
- data.push([key, value]);
1402
- } else {
1403
- data[index][1] = value;
1404
- }
1405
- return this;
1406
- }
1407
-
1408
- /**
1409
- * Creates an list cache object.
1410
- *
1411
- * @private
1412
- * @constructor
1413
- * @param {Array} [entries] The key-value pairs to cache.
1414
- */
1415
- function ListCache(entries) {
1416
- var index = -1,
1417
- length = entries == null ? 0 : entries.length;
1418
-
1419
- this.clear();
1420
- while (++index < length) {
1421
- var entry = entries[index];
1422
- this.set(entry[0], entry[1]);
1423
- }
1424
- }
1425
-
1426
- // Add methods to `ListCache`.
1427
- ListCache.prototype.clear = listCacheClear;
1428
- ListCache.prototype['delete'] = listCacheDelete;
1429
- ListCache.prototype.get = listCacheGet;
1430
- ListCache.prototype.has = listCacheHas;
1431
- ListCache.prototype.set = listCacheSet;
1432
-
1433
- /* Built-in method references that are verified to be native. */
1434
- var Map = getNative(root$1, 'Map');
1435
-
1436
- /**
1437
- * Removes all key-value entries from the map.
1438
- *
1439
- * @private
1440
- * @name clear
1441
- * @memberOf MapCache
1442
- */
1443
- function mapCacheClear() {
1444
- this.size = 0;
1445
- this.__data__ = {
1446
- 'hash': new Hash,
1447
- 'map': new (Map || ListCache),
1448
- 'string': new Hash
12
+ function createErrorHandler(context, _fallbackMessage = "Operation failed") {
13
+ return function(error) {
14
+ const errorMessage = normalizeError(error);
15
+ const fullMessage = `${context}: ${errorMessage}`;
16
+ console.error(fullMessage);
17
+ throw new Error(fullMessage);
1449
18
  };
1450
19
  }
1451
-
1452
- /**
1453
- * Checks if `value` is suitable for use as unique object key.
1454
- *
1455
- * @private
1456
- * @param {*} value The value to check.
1457
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1458
- */
1459
- function isKeyable(value) {
1460
- var type = typeof value;
1461
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1462
- ? (value !== '__proto__')
1463
- : (value === null);
1464
- }
1465
-
1466
- /**
1467
- * Gets the data for `map`.
1468
- *
1469
- * @private
1470
- * @param {Object} map The map to query.
1471
- * @param {string} key The reference key.
1472
- * @returns {*} Returns the map data.
1473
- */
1474
- function getMapData(map, key) {
1475
- var data = map.__data__;
1476
- return isKeyable(key)
1477
- ? data[typeof key == 'string' ? 'string' : 'hash']
1478
- : data.map;
1479
- }
1480
-
1481
- /**
1482
- * Removes `key` and its value from the map.
1483
- *
1484
- * @private
1485
- * @name delete
1486
- * @memberOf MapCache
1487
- * @param {string} key The key of the value to remove.
1488
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1489
- */
1490
- function mapCacheDelete(key) {
1491
- var result = getMapData(this, key)['delete'](key);
1492
- this.size -= result ? 1 : 0;
1493
- return result;
1494
- }
1495
-
1496
- /**
1497
- * Gets the map value for `key`.
1498
- *
1499
- * @private
1500
- * @name get
1501
- * @memberOf MapCache
1502
- * @param {string} key The key of the value to get.
1503
- * @returns {*} Returns the entry value.
1504
- */
1505
- function mapCacheGet(key) {
1506
- return getMapData(this, key).get(key);
1507
- }
1508
-
1509
- /**
1510
- * Checks if a map value for `key` exists.
1511
- *
1512
- * @private
1513
- * @name has
1514
- * @memberOf MapCache
1515
- * @param {string} key The key of the entry to check.
1516
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1517
- */
1518
- function mapCacheHas(key) {
1519
- return getMapData(this, key).has(key);
1520
- }
1521
-
1522
- /**
1523
- * Sets the map `key` to `value`.
1524
- *
1525
- * @private
1526
- * @name set
1527
- * @memberOf MapCache
1528
- * @param {string} key The key of the value to set.
1529
- * @param {*} value The value to set.
1530
- * @returns {Object} Returns the map cache instance.
1531
- */
1532
- function mapCacheSet(key, value) {
1533
- var data = getMapData(this, key),
1534
- size = data.size;
1535
-
1536
- data.set(key, value);
1537
- this.size += data.size == size ? 0 : 1;
1538
- return this;
1539
- }
1540
-
1541
- /**
1542
- * Creates a map cache object to store key-value pairs.
1543
- *
1544
- * @private
1545
- * @constructor
1546
- * @param {Array} [entries] The key-value pairs to cache.
1547
- */
1548
- function MapCache(entries) {
1549
- var index = -1,
1550
- length = entries == null ? 0 : entries.length;
1551
-
1552
- this.clear();
1553
- while (++index < length) {
1554
- var entry = entries[index];
1555
- this.set(entry[0], entry[1]);
1556
- }
1557
- }
1558
-
1559
- // Add methods to `MapCache`.
1560
- MapCache.prototype.clear = mapCacheClear;
1561
- MapCache.prototype['delete'] = mapCacheDelete;
1562
- MapCache.prototype.get = mapCacheGet;
1563
- MapCache.prototype.has = mapCacheHas;
1564
- MapCache.prototype.set = mapCacheSet;
1565
-
1566
- /**
1567
- * Appends the elements of `values` to `array`.
1568
- *
1569
- * @private
1570
- * @param {Array} array The array to modify.
1571
- * @param {Array} values The values to append.
1572
- * @returns {Array} Returns `array`.
1573
- */
1574
- function arrayPush(array, values) {
1575
- var index = -1,
1576
- length = values.length,
1577
- offset = array.length;
1578
-
1579
- while (++index < length) {
1580
- array[offset + index] = values[index];
1581
- }
1582
- return array;
1583
- }
1584
-
1585
- /** Built-in value references. */
1586
- var getPrototype = overArg(Object.getPrototypeOf, Object);
1587
-
1588
- /**
1589
- * Removes all key-value entries from the stack.
1590
- *
1591
- * @private
1592
- * @name clear
1593
- * @memberOf Stack
1594
- */
1595
- function stackClear() {
1596
- this.__data__ = new ListCache;
1597
- this.size = 0;
1598
- }
1599
-
1600
- /**
1601
- * Removes `key` and its value from the stack.
1602
- *
1603
- * @private
1604
- * @name delete
1605
- * @memberOf Stack
1606
- * @param {string} key The key of the value to remove.
1607
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1608
- */
1609
- function stackDelete(key) {
1610
- var data = this.__data__,
1611
- result = data['delete'](key);
1612
-
1613
- this.size = data.size;
1614
- return result;
1615
- }
1616
-
1617
- /**
1618
- * Gets the stack value for `key`.
1619
- *
1620
- * @private
1621
- * @name get
1622
- * @memberOf Stack
1623
- * @param {string} key The key of the value to get.
1624
- * @returns {*} Returns the entry value.
1625
- */
1626
- function stackGet(key) {
1627
- return this.__data__.get(key);
1628
- }
1629
-
1630
- /**
1631
- * Checks if a stack value for `key` exists.
1632
- *
1633
- * @private
1634
- * @name has
1635
- * @memberOf Stack
1636
- * @param {string} key The key of the entry to check.
1637
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1638
- */
1639
- function stackHas(key) {
1640
- return this.__data__.has(key);
1641
- }
1642
-
1643
- /** Used as the size to enable large array optimizations. */
1644
- var LARGE_ARRAY_SIZE = 200;
1645
-
1646
- /**
1647
- * Sets the stack `key` to `value`.
1648
- *
1649
- * @private
1650
- * @name set
1651
- * @memberOf Stack
1652
- * @param {string} key The key of the value to set.
1653
- * @param {*} value The value to set.
1654
- * @returns {Object} Returns the stack cache instance.
1655
- */
1656
- function stackSet(key, value) {
1657
- var data = this.__data__;
1658
- if (data instanceof ListCache) {
1659
- var pairs = data.__data__;
1660
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1661
- pairs.push([key, value]);
1662
- this.size = ++data.size;
1663
- return this;
1664
- }
1665
- data = this.__data__ = new MapCache(pairs);
1666
- }
1667
- data.set(key, value);
1668
- this.size = data.size;
1669
- return this;
1670
- }
1671
-
1672
- /**
1673
- * Creates a stack cache object to store key-value pairs.
1674
- *
1675
- * @private
1676
- * @constructor
1677
- * @param {Array} [entries] The key-value pairs to cache.
1678
- */
1679
- function Stack(entries) {
1680
- var data = this.__data__ = new ListCache(entries);
1681
- this.size = data.size;
1682
- }
1683
-
1684
- // Add methods to `Stack`.
1685
- Stack.prototype.clear = stackClear;
1686
- Stack.prototype['delete'] = stackDelete;
1687
- Stack.prototype.get = stackGet;
1688
- Stack.prototype.has = stackHas;
1689
- Stack.prototype.set = stackSet;
1690
-
1691
- /**
1692
- * The base implementation of `_.assign` without support for multiple sources
1693
- * or `customizer` functions.
1694
- *
1695
- * @private
1696
- * @param {Object} object The destination object.
1697
- * @param {Object} source The source object.
1698
- * @returns {Object} Returns `object`.
1699
- */
1700
- function baseAssign(object, source) {
1701
- return object && copyObject(source, keys(source), object);
1702
- }
1703
-
1704
- /**
1705
- * The base implementation of `_.assignIn` without support for multiple sources
1706
- * or `customizer` functions.
1707
- *
1708
- * @private
1709
- * @param {Object} object The destination object.
1710
- * @param {Object} source The source object.
1711
- * @returns {Object} Returns `object`.
1712
- */
1713
- function baseAssignIn(object, source) {
1714
- return object && copyObject(source, keysIn(source), object);
1715
- }
1716
-
1717
- /** Detect free variable `exports`. */
1718
- var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
1719
-
1720
- /** Detect free variable `module`. */
1721
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
1722
-
1723
- /** Detect the popular CommonJS extension `module.exports`. */
1724
- var moduleExports = freeModule && freeModule.exports === freeExports;
1725
-
1726
- /** Built-in value references. */
1727
- var Buffer = moduleExports ? root$1.Buffer : undefined,
1728
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
1729
-
1730
- /**
1731
- * Creates a clone of `buffer`.
1732
- *
1733
- * @private
1734
- * @param {Buffer} buffer The buffer to clone.
1735
- * @param {boolean} [isDeep] Specify a deep clone.
1736
- * @returns {Buffer} Returns the cloned buffer.
1737
- */
1738
- function cloneBuffer(buffer, isDeep) {
1739
- if (isDeep) {
1740
- return buffer.slice();
1741
- }
1742
- var length = buffer.length,
1743
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1744
-
1745
- buffer.copy(result);
1746
- return result;
1747
- }
1748
-
1749
- /**
1750
- * A specialized version of `_.filter` for arrays without support for
1751
- * iteratee shorthands.
1752
- *
1753
- * @private
1754
- * @param {Array} [array] The array to iterate over.
1755
- * @param {Function} predicate The function invoked per iteration.
1756
- * @returns {Array} Returns the new filtered array.
1757
- */
1758
- function arrayFilter(array, predicate) {
1759
- var index = -1,
1760
- length = array == null ? 0 : array.length,
1761
- resIndex = 0,
1762
- result = [];
1763
-
1764
- while (++index < length) {
1765
- var value = array[index];
1766
- if (predicate(value, index, array)) {
1767
- result[resIndex++] = value;
1768
- }
1769
- }
1770
- return result;
1771
- }
1772
-
1773
- /**
1774
- * This method returns a new empty array.
1775
- *
1776
- * @static
1777
- * @memberOf _
1778
- * @since 4.13.0
1779
- * @category Util
1780
- * @returns {Array} Returns the new empty array.
1781
- * @example
1782
- *
1783
- * var arrays = _.times(2, _.stubArray);
1784
- *
1785
- * console.log(arrays);
1786
- * // => [[], []]
1787
- *
1788
- * console.log(arrays[0] === arrays[1]);
1789
- * // => false
1790
- */
1791
- function stubArray() {
1792
- return [];
1793
- }
1794
-
1795
- /** Used for built-in method references. */
1796
- var objectProto$1 = Object.prototype;
1797
-
1798
- /** Built-in value references. */
1799
- var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
1800
-
1801
- /* Built-in method references for those with the same name as other `lodash` methods. */
1802
- var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
1803
-
1804
- /**
1805
- * Creates an array of the own enumerable symbols of `object`.
1806
- *
1807
- * @private
1808
- * @param {Object} object The object to query.
1809
- * @returns {Array} Returns the array of symbols.
1810
- */
1811
- var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
1812
- if (object == null) {
1813
- return [];
1814
- }
1815
- object = Object(object);
1816
- return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
1817
- return propertyIsEnumerable.call(object, symbol);
1818
- });
1819
- };
1820
-
1821
- /**
1822
- * Copies own symbols of `source` to `object`.
1823
- *
1824
- * @private
1825
- * @param {Object} source The object to copy symbols from.
1826
- * @param {Object} [object={}] The object to copy symbols to.
1827
- * @returns {Object} Returns `object`.
1828
- */
1829
- function copySymbols(source, object) {
1830
- return copyObject(source, getSymbols(source), object);
1831
- }
1832
-
1833
- /* Built-in method references for those with the same name as other `lodash` methods. */
1834
- var nativeGetSymbols = Object.getOwnPropertySymbols;
1835
-
1836
- /**
1837
- * Creates an array of the own and inherited enumerable symbols of `object`.
1838
- *
1839
- * @private
1840
- * @param {Object} object The object to query.
1841
- * @returns {Array} Returns the array of symbols.
1842
- */
1843
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
1844
- var result = [];
1845
- while (object) {
1846
- arrayPush(result, getSymbols(object));
1847
- object = getPrototype(object);
1848
- }
1849
- return result;
1850
- };
1851
-
1852
- /**
1853
- * Copies own and inherited symbols of `source` to `object`.
1854
- *
1855
- * @private
1856
- * @param {Object} source The object to copy symbols from.
1857
- * @param {Object} [object={}] The object to copy symbols to.
1858
- * @returns {Object} Returns `object`.
1859
- */
1860
- function copySymbolsIn(source, object) {
1861
- return copyObject(source, getSymbolsIn(source), object);
1862
- }
1863
-
1864
- /**
1865
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1866
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1867
- * symbols of `object`.
1868
- *
1869
- * @private
1870
- * @param {Object} object The object to query.
1871
- * @param {Function} keysFunc The function to get the keys of `object`.
1872
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
1873
- * @returns {Array} Returns the array of property names and symbols.
1874
- */
1875
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1876
- var result = keysFunc(object);
1877
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
1878
- }
1879
-
1880
- /**
1881
- * Creates an array of own enumerable property names and symbols of `object`.
1882
- *
1883
- * @private
1884
- * @param {Object} object The object to query.
1885
- * @returns {Array} Returns the array of property names and symbols.
1886
- */
1887
- function getAllKeys(object) {
1888
- return baseGetAllKeys(object, keys, getSymbols);
1889
- }
1890
-
1891
- /**
1892
- * Creates an array of own and inherited enumerable property names and
1893
- * symbols of `object`.
1894
- *
1895
- * @private
1896
- * @param {Object} object The object to query.
1897
- * @returns {Array} Returns the array of property names and symbols.
1898
- */
1899
- function getAllKeysIn(object) {
1900
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
1901
- }
1902
-
1903
- /* Built-in method references that are verified to be native. */
1904
- var DataView = getNative(root$1, 'DataView');
1905
-
1906
- /* Built-in method references that are verified to be native. */
1907
- var Promise$1 = getNative(root$1, 'Promise');
1908
-
1909
- /* Built-in method references that are verified to be native. */
1910
- var Set = getNative(root$1, 'Set');
1911
-
1912
- /** `Object#toString` result references. */
1913
- var mapTag$3 = '[object Map]',
1914
- objectTag$1 = '[object Object]',
1915
- promiseTag = '[object Promise]',
1916
- setTag$3 = '[object Set]',
1917
- weakMapTag$1 = '[object WeakMap]';
1918
-
1919
- var dataViewTag$2 = '[object DataView]';
1920
-
1921
- /** Used to detect maps, sets, and weakmaps. */
1922
- var dataViewCtorString = toSource(DataView),
1923
- mapCtorString = toSource(Map),
1924
- promiseCtorString = toSource(Promise$1),
1925
- setCtorString = toSource(Set),
1926
- weakMapCtorString = toSource(WeakMap);
1927
-
1928
- /**
1929
- * Gets the `toStringTag` of `value`.
1930
- *
1931
- * @private
1932
- * @param {*} value The value to query.
1933
- * @returns {string} Returns the `toStringTag`.
1934
- */
1935
- var getTag = baseGetTag;
1936
-
1937
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1938
- if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
1939
- (Map && getTag(new Map) != mapTag$3) ||
1940
- (Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
1941
- (Set && getTag(new Set) != setTag$3) ||
1942
- (WeakMap && getTag(new WeakMap) != weakMapTag$1)) {
1943
- getTag = function(value) {
1944
- var result = baseGetTag(value),
1945
- Ctor = result == objectTag$1 ? value.constructor : undefined,
1946
- ctorString = Ctor ? toSource(Ctor) : '';
1947
-
1948
- if (ctorString) {
1949
- switch (ctorString) {
1950
- case dataViewCtorString: return dataViewTag$2;
1951
- case mapCtorString: return mapTag$3;
1952
- case promiseCtorString: return promiseTag;
1953
- case setCtorString: return setTag$3;
1954
- case weakMapCtorString: return weakMapTag$1;
1955
- }
1956
- }
1957
- return result;
1958
- };
1959
- }
1960
-
1961
- var getTag$1 = getTag;
1962
-
1963
- /** Used for built-in method references. */
1964
- var objectProto = Object.prototype;
1965
-
1966
- /** Used to check objects for own properties. */
1967
- var hasOwnProperty = objectProto.hasOwnProperty;
1968
-
1969
- /**
1970
- * Initializes an array clone.
1971
- *
1972
- * @private
1973
- * @param {Array} array The array to clone.
1974
- * @returns {Array} Returns the initialized clone.
1975
- */
1976
- function initCloneArray(array) {
1977
- var length = array.length,
1978
- result = new array.constructor(length);
1979
-
1980
- // Add properties assigned by `RegExp#exec`.
1981
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
1982
- result.index = array.index;
1983
- result.input = array.input;
1984
- }
1985
- return result;
1986
- }
1987
-
1988
- /** Built-in value references. */
1989
- var Uint8Array = root$1.Uint8Array;
1990
-
1991
- /**
1992
- * Creates a clone of `arrayBuffer`.
1993
- *
1994
- * @private
1995
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
1996
- * @returns {ArrayBuffer} Returns the cloned array buffer.
1997
- */
1998
- function cloneArrayBuffer(arrayBuffer) {
1999
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2000
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
2001
- return result;
2002
- }
2003
-
2004
- /**
2005
- * Creates a clone of `dataView`.
2006
- *
2007
- * @private
2008
- * @param {Object} dataView The data view to clone.
2009
- * @param {boolean} [isDeep] Specify a deep clone.
2010
- * @returns {Object} Returns the cloned data view.
2011
- */
2012
- function cloneDataView(dataView, isDeep) {
2013
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
2014
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2015
- }
2016
-
2017
- /** Used to match `RegExp` flags from their coerced string values. */
2018
- var reFlags = /\w*$/;
2019
-
2020
- /**
2021
- * Creates a clone of `regexp`.
2022
- *
2023
- * @private
2024
- * @param {Object} regexp The regexp to clone.
2025
- * @returns {Object} Returns the cloned regexp.
2026
- */
2027
- function cloneRegExp(regexp) {
2028
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2029
- result.lastIndex = regexp.lastIndex;
2030
- return result;
2031
- }
2032
-
2033
- /** Used to convert symbols to primitives and strings. */
2034
- var symbolProto = Symbol ? Symbol.prototype : undefined,
2035
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
2036
-
2037
- /**
2038
- * Creates a clone of the `symbol` object.
2039
- *
2040
- * @private
2041
- * @param {Object} symbol The symbol object to clone.
2042
- * @returns {Object} Returns the cloned symbol object.
2043
- */
2044
- function cloneSymbol(symbol) {
2045
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2046
- }
2047
-
2048
- /**
2049
- * Creates a clone of `typedArray`.
2050
- *
2051
- * @private
2052
- * @param {Object} typedArray The typed array to clone.
2053
- * @param {boolean} [isDeep] Specify a deep clone.
2054
- * @returns {Object} Returns the cloned typed array.
2055
- */
2056
- function cloneTypedArray(typedArray, isDeep) {
2057
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
2058
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2059
- }
2060
-
2061
- /** `Object#toString` result references. */
2062
- var boolTag$1 = '[object Boolean]',
2063
- dateTag$1 = '[object Date]',
2064
- mapTag$2 = '[object Map]',
2065
- numberTag$1 = '[object Number]',
2066
- regexpTag$1 = '[object RegExp]',
2067
- setTag$2 = '[object Set]',
2068
- stringTag$1 = '[object String]',
2069
- symbolTag$1 = '[object Symbol]';
2070
-
2071
- var arrayBufferTag$1 = '[object ArrayBuffer]',
2072
- dataViewTag$1 = '[object DataView]',
2073
- float32Tag$1 = '[object Float32Array]',
2074
- float64Tag$1 = '[object Float64Array]',
2075
- int8Tag$1 = '[object Int8Array]',
2076
- int16Tag$1 = '[object Int16Array]',
2077
- int32Tag$1 = '[object Int32Array]',
2078
- uint8Tag$1 = '[object Uint8Array]',
2079
- uint8ClampedTag$1 = '[object Uint8ClampedArray]',
2080
- uint16Tag$1 = '[object Uint16Array]',
2081
- uint32Tag$1 = '[object Uint32Array]';
2082
-
2083
- /**
2084
- * Initializes an object clone based on its `toStringTag`.
2085
- *
2086
- * **Note:** This function only supports cloning values with tags of
2087
- * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
2088
- *
2089
- * @private
2090
- * @param {Object} object The object to clone.
2091
- * @param {string} tag The `toStringTag` of the object to clone.
2092
- * @param {boolean} [isDeep] Specify a deep clone.
2093
- * @returns {Object} Returns the initialized clone.
2094
- */
2095
- function initCloneByTag(object, tag, isDeep) {
2096
- var Ctor = object.constructor;
2097
- switch (tag) {
2098
- case arrayBufferTag$1:
2099
- return cloneArrayBuffer(object);
2100
-
2101
- case boolTag$1:
2102
- case dateTag$1:
2103
- return new Ctor(+object);
2104
-
2105
- case dataViewTag$1:
2106
- return cloneDataView(object, isDeep);
2107
-
2108
- case float32Tag$1: case float64Tag$1:
2109
- case int8Tag$1: case int16Tag$1: case int32Tag$1:
2110
- case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
2111
- return cloneTypedArray(object, isDeep);
2112
-
2113
- case mapTag$2:
2114
- return new Ctor;
2115
-
2116
- case numberTag$1:
2117
- case stringTag$1:
2118
- return new Ctor(object);
2119
-
2120
- case regexpTag$1:
2121
- return cloneRegExp(object);
2122
-
2123
- case setTag$2:
2124
- return new Ctor;
2125
-
2126
- case symbolTag$1:
2127
- return cloneSymbol(object);
2128
- }
2129
- }
2130
-
2131
- /**
2132
- * Initializes an object clone.
2133
- *
2134
- * @private
2135
- * @param {Object} object The object to clone.
2136
- * @returns {Object} Returns the initialized clone.
2137
- */
2138
- function initCloneObject(object) {
2139
- return (typeof object.constructor == 'function' && !isPrototype(object))
2140
- ? baseCreate(getPrototype(object))
2141
- : {};
2142
- }
2143
-
2144
- /** `Object#toString` result references. */
2145
- var mapTag$1 = '[object Map]';
2146
-
2147
- /**
2148
- * The base implementation of `_.isMap` without Node.js optimizations.
2149
- *
2150
- * @private
2151
- * @param {*} value The value to check.
2152
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2153
- */
2154
- function baseIsMap(value) {
2155
- return isObjectLike(value) && getTag$1(value) == mapTag$1;
2156
- }
2157
-
2158
- /* Node.js helper references. */
2159
- var nodeIsMap = nodeUtil && nodeUtil.isMap;
2160
-
2161
- /**
2162
- * Checks if `value` is classified as a `Map` object.
2163
- *
2164
- * @static
2165
- * @memberOf _
2166
- * @since 4.3.0
2167
- * @category Lang
2168
- * @param {*} value The value to check.
2169
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
2170
- * @example
2171
- *
2172
- * _.isMap(new Map);
2173
- * // => true
2174
- *
2175
- * _.isMap(new WeakMap);
2176
- * // => false
2177
- */
2178
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
2179
-
2180
- /** `Object#toString` result references. */
2181
- var setTag$1 = '[object Set]';
2182
-
2183
- /**
2184
- * The base implementation of `_.isSet` without Node.js optimizations.
2185
- *
2186
- * @private
2187
- * @param {*} value The value to check.
2188
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2189
- */
2190
- function baseIsSet(value) {
2191
- return isObjectLike(value) && getTag$1(value) == setTag$1;
2192
- }
2193
-
2194
- /* Node.js helper references. */
2195
- var nodeIsSet = nodeUtil && nodeUtil.isSet;
2196
-
2197
- /**
2198
- * Checks if `value` is classified as a `Set` object.
2199
- *
2200
- * @static
2201
- * @memberOf _
2202
- * @since 4.3.0
2203
- * @category Lang
2204
- * @param {*} value The value to check.
2205
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
2206
- * @example
2207
- *
2208
- * _.isSet(new Set);
2209
- * // => true
2210
- *
2211
- * _.isSet(new WeakSet);
2212
- * // => false
2213
- */
2214
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
2215
-
2216
- /** Used to compose bitmasks for cloning. */
2217
- var CLONE_DEEP_FLAG$1 = 1,
2218
- CLONE_FLAT_FLAG = 2,
2219
- CLONE_SYMBOLS_FLAG$1 = 4;
2220
-
2221
- /** `Object#toString` result references. */
2222
- var argsTag = '[object Arguments]',
2223
- arrayTag = '[object Array]',
2224
- boolTag = '[object Boolean]',
2225
- dateTag = '[object Date]',
2226
- errorTag = '[object Error]',
2227
- funcTag = '[object Function]',
2228
- genTag = '[object GeneratorFunction]',
2229
- mapTag = '[object Map]',
2230
- numberTag = '[object Number]',
2231
- objectTag = '[object Object]',
2232
- regexpTag = '[object RegExp]',
2233
- setTag = '[object Set]',
2234
- stringTag = '[object String]',
2235
- symbolTag = '[object Symbol]',
2236
- weakMapTag = '[object WeakMap]';
2237
-
2238
- var arrayBufferTag = '[object ArrayBuffer]',
2239
- dataViewTag = '[object DataView]',
2240
- float32Tag = '[object Float32Array]',
2241
- float64Tag = '[object Float64Array]',
2242
- int8Tag = '[object Int8Array]',
2243
- int16Tag = '[object Int16Array]',
2244
- int32Tag = '[object Int32Array]',
2245
- uint8Tag = '[object Uint8Array]',
2246
- uint8ClampedTag = '[object Uint8ClampedArray]',
2247
- uint16Tag = '[object Uint16Array]',
2248
- uint32Tag = '[object Uint32Array]';
2249
-
2250
- /** Used to identify `toStringTag` values supported by `_.clone`. */
2251
- var cloneableTags = {};
2252
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
2253
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
2254
- cloneableTags[boolTag] = cloneableTags[dateTag] =
2255
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
2256
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
2257
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
2258
- cloneableTags[numberTag] = cloneableTags[objectTag] =
2259
- cloneableTags[regexpTag] = cloneableTags[setTag] =
2260
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
2261
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
2262
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
2263
- cloneableTags[errorTag] = cloneableTags[funcTag] =
2264
- cloneableTags[weakMapTag] = false;
2265
-
2266
- /**
2267
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
2268
- * traversed objects.
2269
- *
2270
- * @private
2271
- * @param {*} value The value to clone.
2272
- * @param {boolean} bitmask The bitmask flags.
2273
- * 1 - Deep clone
2274
- * 2 - Flatten inherited properties
2275
- * 4 - Clone symbols
2276
- * @param {Function} [customizer] The function to customize cloning.
2277
- * @param {string} [key] The key of `value`.
2278
- * @param {Object} [object] The parent object of `value`.
2279
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
2280
- * @returns {*} Returns the cloned value.
2281
- */
2282
- function baseClone(value, bitmask, customizer, key, object, stack) {
2283
- var result,
2284
- isDeep = bitmask & CLONE_DEEP_FLAG$1,
2285
- isFlat = bitmask & CLONE_FLAT_FLAG,
2286
- isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
2287
- if (result !== undefined) {
2288
- return result;
2289
- }
2290
- if (!isObject(value)) {
2291
- return value;
2292
- }
2293
- var isArr = isArray(value);
2294
- if (isArr) {
2295
- result = initCloneArray(value);
2296
- if (!isDeep) {
2297
- return copyArray(value, result);
2298
- }
2299
- } else {
2300
- var tag = getTag$1(value),
2301
- isFunc = tag == funcTag || tag == genTag;
2302
-
2303
- if (isBuffer(value)) {
2304
- return cloneBuffer(value, isDeep);
2305
- }
2306
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
2307
- result = (isFlat || isFunc) ? {} : initCloneObject(value);
2308
- if (!isDeep) {
2309
- return isFlat
2310
- ? copySymbolsIn(value, baseAssignIn(result, value))
2311
- : copySymbols(value, baseAssign(result, value));
2312
- }
2313
- } else {
2314
- if (!cloneableTags[tag]) {
2315
- return object ? value : {};
2316
- }
2317
- result = initCloneByTag(value, tag, isDeep);
2318
- }
2319
- }
2320
- // Check for circular references and return its corresponding clone.
2321
- stack || (stack = new Stack);
2322
- var stacked = stack.get(value);
2323
- if (stacked) {
2324
- return stacked;
2325
- }
2326
- stack.set(value, result);
2327
-
2328
- if (isSet(value)) {
2329
- value.forEach(function(subValue) {
2330
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
2331
- });
2332
- } else if (isMap(value)) {
2333
- value.forEach(function(subValue, key) {
2334
- result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
2335
- });
2336
- }
2337
-
2338
- var keysFunc = isFull
2339
- ? (isFlat ? getAllKeysIn : getAllKeys)
2340
- : (isFlat ? keysIn : keys);
2341
-
2342
- var props = isArr ? undefined : keysFunc(value);
2343
- arrayEach(props || value, function(subValue, key) {
2344
- if (props) {
2345
- key = subValue;
2346
- subValue = value[key];
2347
- }
2348
- // Recursively populate clone (susceptible to call stack limits).
2349
- assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
2350
- });
2351
- return result;
2352
- }
2353
-
2354
- /** Used to compose bitmasks for cloning. */
2355
- var CLONE_DEEP_FLAG = 1,
2356
- CLONE_SYMBOLS_FLAG = 4;
2357
-
2358
- /**
2359
- * This method is like `_.clone` except that it recursively clones `value`.
2360
- *
2361
- * @static
2362
- * @memberOf _
2363
- * @since 1.0.0
2364
- * @category Lang
2365
- * @param {*} value The value to recursively clone.
2366
- * @returns {*} Returns the deep cloned value.
2367
- * @see _.clone
2368
- * @example
2369
- *
2370
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
2371
- *
2372
- * var deep = _.cloneDeep(objects);
2373
- * console.log(deep[0] === objects[0]);
2374
- * // => false
2375
- */
2376
- function cloneDeep(value) {
2377
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
2378
- }
2379
-
2380
- /**
2381
- * Gets the timestamp of the number of milliseconds that have elapsed since
2382
- * the Unix epoch (1 January 1970 00:00:00 UTC).
2383
- *
2384
- * @static
2385
- * @memberOf _
2386
- * @since 2.4.0
2387
- * @category Date
2388
- * @returns {number} Returns the timestamp.
2389
- * @example
2390
- *
2391
- * _.defer(function(stamp) {
2392
- * console.log(_.now() - stamp);
2393
- * }, _.now());
2394
- * // => Logs the number of milliseconds it took for the deferred invocation.
2395
- */
2396
- var now = function() {
2397
- return root$1.Date.now();
2398
- };
2399
-
2400
- /** Error message constants. */
2401
- var FUNC_ERROR_TEXT$1 = 'Expected a function';
2402
-
2403
- /* Built-in method references for those with the same name as other `lodash` methods. */
2404
- var nativeMax = Math.max,
2405
- nativeMin = Math.min;
2406
-
2407
- /**
2408
- * Creates a debounced function that delays invoking `func` until after `wait`
2409
- * milliseconds have elapsed since the last time the debounced function was
2410
- * invoked. The debounced function comes with a `cancel` method to cancel
2411
- * delayed `func` invocations and a `flush` method to immediately invoke them.
2412
- * Provide `options` to indicate whether `func` should be invoked on the
2413
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
2414
- * with the last arguments provided to the debounced function. Subsequent
2415
- * calls to the debounced function return the result of the last `func`
2416
- * invocation.
2417
- *
2418
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
2419
- * invoked on the trailing edge of the timeout only if the debounced function
2420
- * is invoked more than once during the `wait` timeout.
2421
- *
2422
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
2423
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
2424
- *
2425
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
2426
- * for details over the differences between `_.debounce` and `_.throttle`.
2427
- *
2428
- * @static
2429
- * @memberOf _
2430
- * @since 0.1.0
2431
- * @category Function
2432
- * @param {Function} func The function to debounce.
2433
- * @param {number} [wait=0] The number of milliseconds to delay.
2434
- * @param {Object} [options={}] The options object.
2435
- * @param {boolean} [options.leading=false]
2436
- * Specify invoking on the leading edge of the timeout.
2437
- * @param {number} [options.maxWait]
2438
- * The maximum time `func` is allowed to be delayed before it's invoked.
2439
- * @param {boolean} [options.trailing=true]
2440
- * Specify invoking on the trailing edge of the timeout.
2441
- * @returns {Function} Returns the new debounced function.
2442
- * @example
2443
- *
2444
- * // Avoid costly calculations while the window size is in flux.
2445
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
2446
- *
2447
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
2448
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
2449
- * 'leading': true,
2450
- * 'trailing': false
2451
- * }));
2452
- *
2453
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
2454
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
2455
- * var source = new EventSource('/stream');
2456
- * jQuery(source).on('message', debounced);
2457
- *
2458
- * // Cancel the trailing debounced invocation.
2459
- * jQuery(window).on('popstate', debounced.cancel);
2460
- */
2461
- function debounce(func, wait, options) {
2462
- var lastArgs,
2463
- lastThis,
2464
- maxWait,
2465
- result,
2466
- timerId,
2467
- lastCallTime,
2468
- lastInvokeTime = 0,
2469
- leading = false,
2470
- maxing = false,
2471
- trailing = true;
2472
-
2473
- if (typeof func != 'function') {
2474
- throw new TypeError(FUNC_ERROR_TEXT$1);
2475
- }
2476
- wait = toNumber(wait) || 0;
2477
- if (isObject(options)) {
2478
- leading = !!options.leading;
2479
- maxing = 'maxWait' in options;
2480
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
2481
- trailing = 'trailing' in options ? !!options.trailing : trailing;
2482
- }
2483
-
2484
- function invokeFunc(time) {
2485
- var args = lastArgs,
2486
- thisArg = lastThis;
2487
-
2488
- lastArgs = lastThis = undefined;
2489
- lastInvokeTime = time;
2490
- result = func.apply(thisArg, args);
2491
- return result;
2492
- }
2493
-
2494
- function leadingEdge(time) {
2495
- // Reset any `maxWait` timer.
2496
- lastInvokeTime = time;
2497
- // Start the timer for the trailing edge.
2498
- timerId = setTimeout(timerExpired, wait);
2499
- // Invoke the leading edge.
2500
- return leading ? invokeFunc(time) : result;
2501
- }
2502
-
2503
- function remainingWait(time) {
2504
- var timeSinceLastCall = time - lastCallTime,
2505
- timeSinceLastInvoke = time - lastInvokeTime,
2506
- timeWaiting = wait - timeSinceLastCall;
2507
-
2508
- return maxing
2509
- ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
2510
- : timeWaiting;
2511
- }
2512
-
2513
- function shouldInvoke(time) {
2514
- var timeSinceLastCall = time - lastCallTime,
2515
- timeSinceLastInvoke = time - lastInvokeTime;
2516
-
2517
- // Either this is the first call, activity has stopped and we're at the
2518
- // trailing edge, the system time has gone backwards and we're treating
2519
- // it as the trailing edge, or we've hit the `maxWait` limit.
2520
- return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
2521
- (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
2522
- }
2523
-
2524
- function timerExpired() {
2525
- var time = now();
2526
- if (shouldInvoke(time)) {
2527
- return trailingEdge(time);
2528
- }
2529
- // Restart the timer.
2530
- timerId = setTimeout(timerExpired, remainingWait(time));
2531
- }
2532
-
2533
- function trailingEdge(time) {
2534
- timerId = undefined;
2535
-
2536
- // Only invoke if we have `lastArgs` which means `func` has been
2537
- // debounced at least once.
2538
- if (trailing && lastArgs) {
2539
- return invokeFunc(time);
2540
- }
2541
- lastArgs = lastThis = undefined;
2542
- return result;
2543
- }
2544
-
2545
- function cancel() {
2546
- if (timerId !== undefined) {
2547
- clearTimeout(timerId);
2548
- }
2549
- lastInvokeTime = 0;
2550
- lastArgs = lastCallTime = lastThis = timerId = undefined;
2551
- }
2552
-
2553
- function flush() {
2554
- return timerId === undefined ? result : trailingEdge(now());
2555
- }
2556
-
2557
- function debounced() {
2558
- var time = now(),
2559
- isInvoking = shouldInvoke(time);
2560
-
2561
- lastArgs = arguments;
2562
- lastThis = this;
2563
- lastCallTime = time;
2564
-
2565
- if (isInvoking) {
2566
- if (timerId === undefined) {
2567
- return leadingEdge(lastCallTime);
2568
- }
2569
- if (maxing) {
2570
- // Handle invocations in a tight loop.
2571
- clearTimeout(timerId);
2572
- timerId = setTimeout(timerExpired, wait);
2573
- return invokeFunc(lastCallTime);
2574
- }
2575
- }
2576
- if (timerId === undefined) {
2577
- timerId = setTimeout(timerExpired, wait);
2578
- }
2579
- return result;
2580
- }
2581
- debounced.cancel = cancel;
2582
- debounced.flush = flush;
2583
- return debounced;
2584
- }
2585
-
2586
- /** Error message constants. */
2587
- var FUNC_ERROR_TEXT = 'Expected a function';
2588
-
2589
- /**
2590
- * Creates a throttled function that only invokes `func` at most once per
2591
- * every `wait` milliseconds. The throttled function comes with a `cancel`
2592
- * method to cancel delayed `func` invocations and a `flush` method to
2593
- * immediately invoke them. Provide `options` to indicate whether `func`
2594
- * should be invoked on the leading and/or trailing edge of the `wait`
2595
- * timeout. The `func` is invoked with the last arguments provided to the
2596
- * throttled function. Subsequent calls to the throttled function return the
2597
- * result of the last `func` invocation.
2598
- *
2599
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
2600
- * invoked on the trailing edge of the timeout only if the throttled function
2601
- * is invoked more than once during the `wait` timeout.
2602
- *
2603
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
2604
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
2605
- *
2606
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
2607
- * for details over the differences between `_.throttle` and `_.debounce`.
2608
- *
2609
- * @static
2610
- * @memberOf _
2611
- * @since 0.1.0
2612
- * @category Function
2613
- * @param {Function} func The function to throttle.
2614
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
2615
- * @param {Object} [options={}] The options object.
2616
- * @param {boolean} [options.leading=true]
2617
- * Specify invoking on the leading edge of the timeout.
2618
- * @param {boolean} [options.trailing=true]
2619
- * Specify invoking on the trailing edge of the timeout.
2620
- * @returns {Function} Returns the new throttled function.
2621
- * @example
2622
- *
2623
- * // Avoid excessively updating the position while scrolling.
2624
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
2625
- *
2626
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
2627
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
2628
- * jQuery(element).on('click', throttled);
2629
- *
2630
- * // Cancel the trailing throttled invocation.
2631
- * jQuery(window).on('popstate', throttled.cancel);
2632
- */
2633
- function throttle(func, wait, options) {
2634
- var leading = true,
2635
- trailing = true;
2636
-
2637
- if (typeof func != 'function') {
2638
- throw new TypeError(FUNC_ERROR_TEXT);
2639
- }
2640
- if (isObject(options)) {
2641
- leading = 'leading' in options ? !!options.leading : leading;
2642
- trailing = 'trailing' in options ? !!options.trailing : trailing;
2643
- }
2644
- return debounce(func, wait, {
2645
- 'leading': leading,
2646
- 'maxWait': wait,
2647
- 'trailing': trailing
2648
- });
20
+ function isNonNull(value) {
21
+ return value !== null && value !== void 0;
2649
22
  }
2650
23
 
2651
- export { debounce, cloneDeep as deepClone, throttle };
24
+ export { createErrorHandler, isNonNull, normalizeError };