@hybridly/vite 0.10.0-beta.2 → 0.10.0-beta.21

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.
@@ -1,1412 +0,0 @@
1
- import { t as __commonJSMin } from "../rolldown-runtime.mjs";
2
-
3
- //#region ../../node_modules/lodash.clonedeep/index.js
4
- var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
- /**
6
- * lodash (Custom Build) <https://lodash.com/>
7
- * Build: `lodash modularize exports="npm" -o ./`
8
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
9
- * Released under MIT license <https://lodash.com/license>
10
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
11
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
12
- */
13
- /** Used as the size to enable large array optimizations. */
14
- var LARGE_ARRAY_SIZE = 200;
15
- /** Used to stand-in for `undefined` hash values. */
16
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
17
- /** Used as references for various `Number` constants. */
18
- var MAX_SAFE_INTEGER = 9007199254740991;
19
- /** `Object#toString` result references. */
20
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", promiseTag = "[object Promise]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
21
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
22
- /**
23
- * Used to match `RegExp`
24
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
25
- */
26
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
27
- /** Used to match `RegExp` flags from their coerced string values. */
28
- var reFlags = /\w*$/;
29
- /** Used to detect host constructors (Safari). */
30
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
31
- /** Used to detect unsigned integer values. */
32
- var reIsUint = /^(?:0|[1-9]\d*)$/;
33
- /** Used to identify `toStringTag` values supported by `_.clone`. */
34
- var cloneableTags = {};
35
- cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
36
- cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
37
- /** Detect free variable `global` from Node.js. */
38
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
39
- /** Detect free variable `self`. */
40
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
41
- /** Used as a reference to the global object. */
42
- var root = freeGlobal || freeSelf || Function("return this")();
43
- /** Detect free variable `exports`. */
44
- var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
45
- /** Detect free variable `module`. */
46
- var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
47
- /** Detect the popular CommonJS extension `module.exports`. */
48
- var moduleExports = freeModule && freeModule.exports === freeExports;
49
- /**
50
- * Adds the key-value `pair` to `map`.
51
- *
52
- * @private
53
- * @param {Object} map The map to modify.
54
- * @param {Array} pair The key-value pair to add.
55
- * @returns {Object} Returns `map`.
56
- */
57
- function addMapEntry(map, pair) {
58
- map.set(pair[0], pair[1]);
59
- return map;
60
- }
61
- /**
62
- * Adds `value` to `set`.
63
- *
64
- * @private
65
- * @param {Object} set The set to modify.
66
- * @param {*} value The value to add.
67
- * @returns {Object} Returns `set`.
68
- */
69
- function addSetEntry(set, value) {
70
- set.add(value);
71
- return set;
72
- }
73
- /**
74
- * A specialized version of `_.forEach` for arrays without support for
75
- * iteratee shorthands.
76
- *
77
- * @private
78
- * @param {Array} [array] The array to iterate over.
79
- * @param {Function} iteratee The function invoked per iteration.
80
- * @returns {Array} Returns `array`.
81
- */
82
- function arrayEach(array, iteratee) {
83
- var index = -1, length = array ? array.length : 0;
84
- while (++index < length) if (iteratee(array[index], index, array) === false) break;
85
- return array;
86
- }
87
- /**
88
- * Appends the elements of `values` to `array`.
89
- *
90
- * @private
91
- * @param {Array} array The array to modify.
92
- * @param {Array} values The values to append.
93
- * @returns {Array} Returns `array`.
94
- */
95
- function arrayPush(array, values) {
96
- var index = -1, length = values.length, offset = array.length;
97
- while (++index < length) array[offset + index] = values[index];
98
- return array;
99
- }
100
- /**
101
- * A specialized version of `_.reduce` for arrays without support for
102
- * iteratee shorthands.
103
- *
104
- * @private
105
- * @param {Array} [array] The array to iterate over.
106
- * @param {Function} iteratee The function invoked per iteration.
107
- * @param {*} [accumulator] The initial value.
108
- * @param {boolean} [initAccum] Specify using the first element of `array` as
109
- * the initial value.
110
- * @returns {*} Returns the accumulated value.
111
- */
112
- function arrayReduce(array, iteratee, accumulator, initAccum) {
113
- var index = -1, length = array ? array.length : 0;
114
- if (initAccum && length) accumulator = array[++index];
115
- while (++index < length) accumulator = iteratee(accumulator, array[index], index, array);
116
- return accumulator;
117
- }
118
- /**
119
- * The base implementation of `_.times` without support for iteratee shorthands
120
- * or max array length checks.
121
- *
122
- * @private
123
- * @param {number} n The number of times to invoke `iteratee`.
124
- * @param {Function} iteratee The function invoked per iteration.
125
- * @returns {Array} Returns the array of results.
126
- */
127
- function baseTimes(n, iteratee) {
128
- var index = -1, result = Array(n);
129
- while (++index < n) result[index] = iteratee(index);
130
- return result;
131
- }
132
- /**
133
- * Gets the value at `key` of `object`.
134
- *
135
- * @private
136
- * @param {Object} [object] The object to query.
137
- * @param {string} key The key of the property to get.
138
- * @returns {*} Returns the property value.
139
- */
140
- function getValue(object, key) {
141
- return object == null ? void 0 : object[key];
142
- }
143
- /**
144
- * Checks if `value` is a host object in IE < 9.
145
- *
146
- * @private
147
- * @param {*} value The value to check.
148
- * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
149
- */
150
- function isHostObject(value) {
151
- var result = false;
152
- if (value != null && typeof value.toString != "function") try {
153
- result = !!(value + "");
154
- } catch (e) {}
155
- return result;
156
- }
157
- /**
158
- * Converts `map` to its key-value pairs.
159
- *
160
- * @private
161
- * @param {Object} map The map to convert.
162
- * @returns {Array} Returns the key-value pairs.
163
- */
164
- function mapToArray(map) {
165
- var index = -1, result = Array(map.size);
166
- map.forEach(function(value, key) {
167
- result[++index] = [key, value];
168
- });
169
- return result;
170
- }
171
- /**
172
- * Creates a unary function that invokes `func` with its argument transformed.
173
- *
174
- * @private
175
- * @param {Function} func The function to wrap.
176
- * @param {Function} transform The argument transform.
177
- * @returns {Function} Returns the new function.
178
- */
179
- function overArg(func, transform) {
180
- return function(arg) {
181
- return func(transform(arg));
182
- };
183
- }
184
- /**
185
- * Converts `set` to an array of its values.
186
- *
187
- * @private
188
- * @param {Object} set The set to convert.
189
- * @returns {Array} Returns the values.
190
- */
191
- function setToArray(set) {
192
- var index = -1, result = Array(set.size);
193
- set.forEach(function(value) {
194
- result[++index] = value;
195
- });
196
- return result;
197
- }
198
- /** Used for built-in method references. */
199
- var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
200
- /** Used to detect overreaching core-js shims. */
201
- var coreJsData = root["__core-js_shared__"];
202
- /** Used to detect methods masquerading as native. */
203
- var maskSrcKey = function() {
204
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
205
- return uid ? "Symbol(src)_1." + uid : "";
206
- }();
207
- /** Used to resolve the decompiled source of functions. */
208
- var funcToString = funcProto.toString;
209
- /** Used to check objects for own properties. */
210
- var hasOwnProperty = objectProto.hasOwnProperty;
211
- /**
212
- * Used to resolve the
213
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
214
- * of values.
215
- */
216
- var objectToString = objectProto.toString;
217
- /** Used to detect if a method is native. */
218
- var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
219
- /** Built-in value references. */
220
- var Buffer = moduleExports ? root.Buffer : void 0, Symbol = root.Symbol, Uint8Array = root.Uint8Array, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice;
221
- var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
222
- var DataView = getNative(root, "DataView"), Map = getNative(root, "Map"), Promise = getNative(root, "Promise"), Set = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
223
- /** Used to detect maps, sets, and weakmaps. */
224
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
225
- /** Used to convert symbols to primitives and strings. */
226
- var symbolProto = Symbol ? Symbol.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
227
- /**
228
- * Creates a hash object.
229
- *
230
- * @private
231
- * @constructor
232
- * @param {Array} [entries] The key-value pairs to cache.
233
- */
234
- function Hash(entries) {
235
- var index = -1, length = entries ? entries.length : 0;
236
- this.clear();
237
- while (++index < length) {
238
- var entry = entries[index];
239
- this.set(entry[0], entry[1]);
240
- }
241
- }
242
- /**
243
- * Removes all key-value entries from the hash.
244
- *
245
- * @private
246
- * @name clear
247
- * @memberOf Hash
248
- */
249
- function hashClear() {
250
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
251
- }
252
- /**
253
- * Removes `key` and its value from the hash.
254
- *
255
- * @private
256
- * @name delete
257
- * @memberOf Hash
258
- * @param {Object} hash The hash to modify.
259
- * @param {string} key The key of the value to remove.
260
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
261
- */
262
- function hashDelete(key) {
263
- return this.has(key) && delete this.__data__[key];
264
- }
265
- /**
266
- * Gets the hash value for `key`.
267
- *
268
- * @private
269
- * @name get
270
- * @memberOf Hash
271
- * @param {string} key The key of the value to get.
272
- * @returns {*} Returns the entry value.
273
- */
274
- function hashGet(key) {
275
- var data = this.__data__;
276
- if (nativeCreate) {
277
- var result = data[key];
278
- return result === HASH_UNDEFINED ? void 0 : result;
279
- }
280
- return hasOwnProperty.call(data, key) ? data[key] : void 0;
281
- }
282
- /**
283
- * Checks if a hash value for `key` exists.
284
- *
285
- * @private
286
- * @name has
287
- * @memberOf Hash
288
- * @param {string} key The key of the entry to check.
289
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
290
- */
291
- function hashHas(key) {
292
- var data = this.__data__;
293
- return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
294
- }
295
- /**
296
- * Sets the hash `key` to `value`.
297
- *
298
- * @private
299
- * @name set
300
- * @memberOf Hash
301
- * @param {string} key The key of the value to set.
302
- * @param {*} value The value to set.
303
- * @returns {Object} Returns the hash instance.
304
- */
305
- function hashSet(key, value) {
306
- var data = this.__data__;
307
- data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
308
- return this;
309
- }
310
- Hash.prototype.clear = hashClear;
311
- Hash.prototype["delete"] = hashDelete;
312
- Hash.prototype.get = hashGet;
313
- Hash.prototype.has = hashHas;
314
- Hash.prototype.set = hashSet;
315
- /**
316
- * Creates an list cache object.
317
- *
318
- * @private
319
- * @constructor
320
- * @param {Array} [entries] The key-value pairs to cache.
321
- */
322
- function ListCache(entries) {
323
- var index = -1, length = entries ? entries.length : 0;
324
- this.clear();
325
- while (++index < length) {
326
- var entry = entries[index];
327
- this.set(entry[0], entry[1]);
328
- }
329
- }
330
- /**
331
- * Removes all key-value entries from the list cache.
332
- *
333
- * @private
334
- * @name clear
335
- * @memberOf ListCache
336
- */
337
- function listCacheClear() {
338
- this.__data__ = [];
339
- }
340
- /**
341
- * Removes `key` and its value from the list cache.
342
- *
343
- * @private
344
- * @name delete
345
- * @memberOf ListCache
346
- * @param {string} key The key of the value to remove.
347
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
348
- */
349
- function listCacheDelete(key) {
350
- var data = this.__data__, index = assocIndexOf(data, key);
351
- if (index < 0) return false;
352
- if (index == data.length - 1) data.pop();
353
- else splice.call(data, index, 1);
354
- return true;
355
- }
356
- /**
357
- * Gets the list cache value for `key`.
358
- *
359
- * @private
360
- * @name get
361
- * @memberOf ListCache
362
- * @param {string} key The key of the value to get.
363
- * @returns {*} Returns the entry value.
364
- */
365
- function listCacheGet(key) {
366
- var data = this.__data__, index = assocIndexOf(data, key);
367
- return index < 0 ? void 0 : data[index][1];
368
- }
369
- /**
370
- * Checks if a list cache value for `key` exists.
371
- *
372
- * @private
373
- * @name has
374
- * @memberOf ListCache
375
- * @param {string} key The key of the entry to check.
376
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
377
- */
378
- function listCacheHas(key) {
379
- return assocIndexOf(this.__data__, key) > -1;
380
- }
381
- /**
382
- * Sets the list cache `key` to `value`.
383
- *
384
- * @private
385
- * @name set
386
- * @memberOf ListCache
387
- * @param {string} key The key of the value to set.
388
- * @param {*} value The value to set.
389
- * @returns {Object} Returns the list cache instance.
390
- */
391
- function listCacheSet(key, value) {
392
- var data = this.__data__, index = assocIndexOf(data, key);
393
- if (index < 0) data.push([key, value]);
394
- else data[index][1] = value;
395
- return this;
396
- }
397
- ListCache.prototype.clear = listCacheClear;
398
- ListCache.prototype["delete"] = listCacheDelete;
399
- ListCache.prototype.get = listCacheGet;
400
- ListCache.prototype.has = listCacheHas;
401
- ListCache.prototype.set = listCacheSet;
402
- /**
403
- * Creates a map cache object to store key-value pairs.
404
- *
405
- * @private
406
- * @constructor
407
- * @param {Array} [entries] The key-value pairs to cache.
408
- */
409
- function MapCache(entries) {
410
- var index = -1, length = entries ? entries.length : 0;
411
- this.clear();
412
- while (++index < length) {
413
- var entry = entries[index];
414
- this.set(entry[0], entry[1]);
415
- }
416
- }
417
- /**
418
- * Removes all key-value entries from the map.
419
- *
420
- * @private
421
- * @name clear
422
- * @memberOf MapCache
423
- */
424
- function mapCacheClear() {
425
- this.__data__ = {
426
- "hash": new Hash(),
427
- "map": new (Map || ListCache)(),
428
- "string": new Hash()
429
- };
430
- }
431
- /**
432
- * Removes `key` and its value from the map.
433
- *
434
- * @private
435
- * @name delete
436
- * @memberOf MapCache
437
- * @param {string} key The key of the value to remove.
438
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
439
- */
440
- function mapCacheDelete(key) {
441
- return getMapData(this, key)["delete"](key);
442
- }
443
- /**
444
- * Gets the map value for `key`.
445
- *
446
- * @private
447
- * @name get
448
- * @memberOf MapCache
449
- * @param {string} key The key of the value to get.
450
- * @returns {*} Returns the entry value.
451
- */
452
- function mapCacheGet(key) {
453
- return getMapData(this, key).get(key);
454
- }
455
- /**
456
- * Checks if a map value for `key` exists.
457
- *
458
- * @private
459
- * @name has
460
- * @memberOf MapCache
461
- * @param {string} key The key of the entry to check.
462
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
463
- */
464
- function mapCacheHas(key) {
465
- return getMapData(this, key).has(key);
466
- }
467
- /**
468
- * Sets the map `key` to `value`.
469
- *
470
- * @private
471
- * @name set
472
- * @memberOf MapCache
473
- * @param {string} key The key of the value to set.
474
- * @param {*} value The value to set.
475
- * @returns {Object} Returns the map cache instance.
476
- */
477
- function mapCacheSet(key, value) {
478
- getMapData(this, key).set(key, value);
479
- return this;
480
- }
481
- MapCache.prototype.clear = mapCacheClear;
482
- MapCache.prototype["delete"] = mapCacheDelete;
483
- MapCache.prototype.get = mapCacheGet;
484
- MapCache.prototype.has = mapCacheHas;
485
- MapCache.prototype.set = mapCacheSet;
486
- /**
487
- * Creates a stack cache object to store key-value pairs.
488
- *
489
- * @private
490
- * @constructor
491
- * @param {Array} [entries] The key-value pairs to cache.
492
- */
493
- function Stack(entries) {
494
- this.__data__ = new ListCache(entries);
495
- }
496
- /**
497
- * Removes all key-value entries from the stack.
498
- *
499
- * @private
500
- * @name clear
501
- * @memberOf Stack
502
- */
503
- function stackClear() {
504
- this.__data__ = new ListCache();
505
- }
506
- /**
507
- * Removes `key` and its value from the stack.
508
- *
509
- * @private
510
- * @name delete
511
- * @memberOf Stack
512
- * @param {string} key The key of the value to remove.
513
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
514
- */
515
- function stackDelete(key) {
516
- return this.__data__["delete"](key);
517
- }
518
- /**
519
- * Gets the stack value for `key`.
520
- *
521
- * @private
522
- * @name get
523
- * @memberOf Stack
524
- * @param {string} key The key of the value to get.
525
- * @returns {*} Returns the entry value.
526
- */
527
- function stackGet(key) {
528
- return this.__data__.get(key);
529
- }
530
- /**
531
- * Checks if a stack value for `key` exists.
532
- *
533
- * @private
534
- * @name has
535
- * @memberOf Stack
536
- * @param {string} key The key of the entry to check.
537
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
538
- */
539
- function stackHas(key) {
540
- return this.__data__.has(key);
541
- }
542
- /**
543
- * Sets the stack `key` to `value`.
544
- *
545
- * @private
546
- * @name set
547
- * @memberOf Stack
548
- * @param {string} key The key of the value to set.
549
- * @param {*} value The value to set.
550
- * @returns {Object} Returns the stack cache instance.
551
- */
552
- function stackSet(key, value) {
553
- var cache = this.__data__;
554
- if (cache instanceof ListCache) {
555
- var pairs = cache.__data__;
556
- if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
557
- pairs.push([key, value]);
558
- return this;
559
- }
560
- cache = this.__data__ = new MapCache(pairs);
561
- }
562
- cache.set(key, value);
563
- return this;
564
- }
565
- Stack.prototype.clear = stackClear;
566
- Stack.prototype["delete"] = stackDelete;
567
- Stack.prototype.get = stackGet;
568
- Stack.prototype.has = stackHas;
569
- Stack.prototype.set = stackSet;
570
- /**
571
- * Creates an array of the enumerable property names of the array-like `value`.
572
- *
573
- * @private
574
- * @param {*} value The value to query.
575
- * @param {boolean} inherited Specify returning inherited property names.
576
- * @returns {Array} Returns the array of property names.
577
- */
578
- function arrayLikeKeys(value, inherited) {
579
- var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
580
- var length = result.length, skipIndexes = !!length;
581
- for (var key in value) if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) result.push(key);
582
- return result;
583
- }
584
- /**
585
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
586
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
587
- * for equality comparisons.
588
- *
589
- * @private
590
- * @param {Object} object The object to modify.
591
- * @param {string} key The key of the property to assign.
592
- * @param {*} value The value to assign.
593
- */
594
- function assignValue(object, key, value) {
595
- var objValue = object[key];
596
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) object[key] = value;
597
- }
598
- /**
599
- * Gets the index at which the `key` is found in `array` of key-value pairs.
600
- *
601
- * @private
602
- * @param {Array} array The array to inspect.
603
- * @param {*} key The key to search for.
604
- * @returns {number} Returns the index of the matched value, else `-1`.
605
- */
606
- function assocIndexOf(array, key) {
607
- var length = array.length;
608
- while (length--) if (eq(array[length][0], key)) return length;
609
- return -1;
610
- }
611
- /**
612
- * The base implementation of `_.assign` without support for multiple sources
613
- * or `customizer` functions.
614
- *
615
- * @private
616
- * @param {Object} object The destination object.
617
- * @param {Object} source The source object.
618
- * @returns {Object} Returns `object`.
619
- */
620
- function baseAssign(object, source) {
621
- return object && copyObject(source, keys(source), object);
622
- }
623
- /**
624
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
625
- * traversed objects.
626
- *
627
- * @private
628
- * @param {*} value The value to clone.
629
- * @param {boolean} [isDeep] Specify a deep clone.
630
- * @param {boolean} [isFull] Specify a clone including symbols.
631
- * @param {Function} [customizer] The function to customize cloning.
632
- * @param {string} [key] The key of `value`.
633
- * @param {Object} [object] The parent object of `value`.
634
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
635
- * @returns {*} Returns the cloned value.
636
- */
637
- function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
638
- var result;
639
- if (customizer) result = object ? customizer(value, key, object, stack) : customizer(value);
640
- if (result !== void 0) return result;
641
- if (!isObject(value)) return value;
642
- var isArr = isArray(value);
643
- if (isArr) {
644
- result = initCloneArray(value);
645
- if (!isDeep) return copyArray(value, result);
646
- } else {
647
- var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
648
- if (isBuffer(value)) return cloneBuffer(value, isDeep);
649
- if (tag == objectTag || tag == argsTag || isFunc && !object) {
650
- if (isHostObject(value)) return object ? value : {};
651
- result = initCloneObject(isFunc ? {} : value);
652
- if (!isDeep) return copySymbols(value, baseAssign(result, value));
653
- } else {
654
- if (!cloneableTags[tag]) return object ? value : {};
655
- result = initCloneByTag(value, tag, baseClone, isDeep);
656
- }
657
- }
658
- stack || (stack = new Stack());
659
- var stacked = stack.get(value);
660
- if (stacked) return stacked;
661
- stack.set(value, result);
662
- if (!isArr) var props = isFull ? getAllKeys(value) : keys(value);
663
- arrayEach(props || value, function(subValue, key$1) {
664
- if (props) {
665
- key$1 = subValue;
666
- subValue = value[key$1];
667
- }
668
- assignValue(result, key$1, baseClone(subValue, isDeep, isFull, customizer, key$1, value, stack));
669
- });
670
- return result;
671
- }
672
- /**
673
- * The base implementation of `_.create` without support for assigning
674
- * properties to the created object.
675
- *
676
- * @private
677
- * @param {Object} prototype The object to inherit from.
678
- * @returns {Object} Returns the new object.
679
- */
680
- function baseCreate(proto) {
681
- return isObject(proto) ? objectCreate(proto) : {};
682
- }
683
- /**
684
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
685
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
686
- * symbols of `object`.
687
- *
688
- * @private
689
- * @param {Object} object The object to query.
690
- * @param {Function} keysFunc The function to get the keys of `object`.
691
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
692
- * @returns {Array} Returns the array of property names and symbols.
693
- */
694
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
695
- var result = keysFunc(object);
696
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
697
- }
698
- /**
699
- * The base implementation of `getTag`.
700
- *
701
- * @private
702
- * @param {*} value The value to query.
703
- * @returns {string} Returns the `toStringTag`.
704
- */
705
- function baseGetTag(value) {
706
- return objectToString.call(value);
707
- }
708
- /**
709
- * The base implementation of `_.isNative` without bad shim checks.
710
- *
711
- * @private
712
- * @param {*} value The value to check.
713
- * @returns {boolean} Returns `true` if `value` is a native function,
714
- * else `false`.
715
- */
716
- function baseIsNative(value) {
717
- if (!isObject(value) || isMasked(value)) return false;
718
- return (isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor).test(toSource(value));
719
- }
720
- /**
721
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
722
- *
723
- * @private
724
- * @param {Object} object The object to query.
725
- * @returns {Array} Returns the array of property names.
726
- */
727
- function baseKeys(object) {
728
- if (!isPrototype(object)) return nativeKeys(object);
729
- var result = [];
730
- for (var key in Object(object)) if (hasOwnProperty.call(object, key) && key != "constructor") result.push(key);
731
- return result;
732
- }
733
- /**
734
- * Creates a clone of `buffer`.
735
- *
736
- * @private
737
- * @param {Buffer} buffer The buffer to clone.
738
- * @param {boolean} [isDeep] Specify a deep clone.
739
- * @returns {Buffer} Returns the cloned buffer.
740
- */
741
- function cloneBuffer(buffer, isDeep) {
742
- if (isDeep) return buffer.slice();
743
- var result = new buffer.constructor(buffer.length);
744
- buffer.copy(result);
745
- return result;
746
- }
747
- /**
748
- * Creates a clone of `arrayBuffer`.
749
- *
750
- * @private
751
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
752
- * @returns {ArrayBuffer} Returns the cloned array buffer.
753
- */
754
- function cloneArrayBuffer(arrayBuffer) {
755
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
756
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
757
- return result;
758
- }
759
- /**
760
- * Creates a clone of `dataView`.
761
- *
762
- * @private
763
- * @param {Object} dataView The data view to clone.
764
- * @param {boolean} [isDeep] Specify a deep clone.
765
- * @returns {Object} Returns the cloned data view.
766
- */
767
- function cloneDataView(dataView, isDeep) {
768
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
769
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
770
- }
771
- /**
772
- * Creates a clone of `map`.
773
- *
774
- * @private
775
- * @param {Object} map The map to clone.
776
- * @param {Function} cloneFunc The function to clone values.
777
- * @param {boolean} [isDeep] Specify a deep clone.
778
- * @returns {Object} Returns the cloned map.
779
- */
780
- function cloneMap(map, isDeep, cloneFunc) {
781
- return arrayReduce(isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map), addMapEntry, new map.constructor());
782
- }
783
- /**
784
- * Creates a clone of `regexp`.
785
- *
786
- * @private
787
- * @param {Object} regexp The regexp to clone.
788
- * @returns {Object} Returns the cloned regexp.
789
- */
790
- function cloneRegExp(regexp) {
791
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
792
- result.lastIndex = regexp.lastIndex;
793
- return result;
794
- }
795
- /**
796
- * Creates a clone of `set`.
797
- *
798
- * @private
799
- * @param {Object} set The set to clone.
800
- * @param {Function} cloneFunc The function to clone values.
801
- * @param {boolean} [isDeep] Specify a deep clone.
802
- * @returns {Object} Returns the cloned set.
803
- */
804
- function cloneSet(set, isDeep, cloneFunc) {
805
- return arrayReduce(isDeep ? cloneFunc(setToArray(set), true) : setToArray(set), addSetEntry, new set.constructor());
806
- }
807
- /**
808
- * Creates a clone of the `symbol` object.
809
- *
810
- * @private
811
- * @param {Object} symbol The symbol object to clone.
812
- * @returns {Object} Returns the cloned symbol object.
813
- */
814
- function cloneSymbol(symbol) {
815
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
816
- }
817
- /**
818
- * Creates a clone of `typedArray`.
819
- *
820
- * @private
821
- * @param {Object} typedArray The typed array to clone.
822
- * @param {boolean} [isDeep] Specify a deep clone.
823
- * @returns {Object} Returns the cloned typed array.
824
- */
825
- function cloneTypedArray(typedArray, isDeep) {
826
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
827
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
828
- }
829
- /**
830
- * Copies the values of `source` to `array`.
831
- *
832
- * @private
833
- * @param {Array} source The array to copy values from.
834
- * @param {Array} [array=[]] The array to copy values to.
835
- * @returns {Array} Returns `array`.
836
- */
837
- function copyArray(source, array) {
838
- var index = -1, length = source.length;
839
- array || (array = Array(length));
840
- while (++index < length) array[index] = source[index];
841
- return array;
842
- }
843
- /**
844
- * Copies properties of `source` to `object`.
845
- *
846
- * @private
847
- * @param {Object} source The object to copy properties from.
848
- * @param {Array} props The property identifiers to copy.
849
- * @param {Object} [object={}] The object to copy properties to.
850
- * @param {Function} [customizer] The function to customize copied values.
851
- * @returns {Object} Returns `object`.
852
- */
853
- function copyObject(source, props, object, customizer) {
854
- object || (object = {});
855
- var index = -1, length = props.length;
856
- while (++index < length) {
857
- var key = props[index];
858
- var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
859
- assignValue(object, key, newValue === void 0 ? source[key] : newValue);
860
- }
861
- return object;
862
- }
863
- /**
864
- * Copies own symbol properties of `source` to `object`.
865
- *
866
- * @private
867
- * @param {Object} source The object to copy symbols from.
868
- * @param {Object} [object={}] The object to copy symbols to.
869
- * @returns {Object} Returns `object`.
870
- */
871
- function copySymbols(source, object) {
872
- return copyObject(source, getSymbols(source), object);
873
- }
874
- /**
875
- * Creates an array of own enumerable property names and symbols of `object`.
876
- *
877
- * @private
878
- * @param {Object} object The object to query.
879
- * @returns {Array} Returns the array of property names and symbols.
880
- */
881
- function getAllKeys(object) {
882
- return baseGetAllKeys(object, keys, getSymbols);
883
- }
884
- /**
885
- * Gets the data for `map`.
886
- *
887
- * @private
888
- * @param {Object} map The map to query.
889
- * @param {string} key The reference key.
890
- * @returns {*} Returns the map data.
891
- */
892
- function getMapData(map, key) {
893
- var data = map.__data__;
894
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
895
- }
896
- /**
897
- * Gets the native function at `key` of `object`.
898
- *
899
- * @private
900
- * @param {Object} object The object to query.
901
- * @param {string} key The key of the method to get.
902
- * @returns {*} Returns the function if it's native, else `undefined`.
903
- */
904
- function getNative(object, key) {
905
- var value = getValue(object, key);
906
- return baseIsNative(value) ? value : void 0;
907
- }
908
- /**
909
- * Creates an array of the own enumerable symbol properties of `object`.
910
- *
911
- * @private
912
- * @param {Object} object The object to query.
913
- * @returns {Array} Returns the array of symbols.
914
- */
915
- var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
916
- /**
917
- * Gets the `toStringTag` of `value`.
918
- *
919
- * @private
920
- * @param {*} value The value to query.
921
- * @returns {string} Returns the `toStringTag`.
922
- */
923
- var getTag = baseGetTag;
924
- if (DataView && getTag(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) getTag = function(value) {
925
- var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
926
- if (ctorString) switch (ctorString) {
927
- case dataViewCtorString: return dataViewTag;
928
- case mapCtorString: return mapTag;
929
- case promiseCtorString: return promiseTag;
930
- case setCtorString: return setTag;
931
- case weakMapCtorString: return weakMapTag;
932
- }
933
- return result;
934
- };
935
- /**
936
- * Initializes an array clone.
937
- *
938
- * @private
939
- * @param {Array} array The array to clone.
940
- * @returns {Array} Returns the initialized clone.
941
- */
942
- function initCloneArray(array) {
943
- var length = array.length, result = array.constructor(length);
944
- if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
945
- result.index = array.index;
946
- result.input = array.input;
947
- }
948
- return result;
949
- }
950
- /**
951
- * Initializes an object clone.
952
- *
953
- * @private
954
- * @param {Object} object The object to clone.
955
- * @returns {Object} Returns the initialized clone.
956
- */
957
- function initCloneObject(object) {
958
- return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
959
- }
960
- /**
961
- * Initializes an object clone based on its `toStringTag`.
962
- *
963
- * **Note:** This function only supports cloning values with tags of
964
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
965
- *
966
- * @private
967
- * @param {Object} object The object to clone.
968
- * @param {string} tag The `toStringTag` of the object to clone.
969
- * @param {Function} cloneFunc The function to clone values.
970
- * @param {boolean} [isDeep] Specify a deep clone.
971
- * @returns {Object} Returns the initialized clone.
972
- */
973
- function initCloneByTag(object, tag, cloneFunc, isDeep) {
974
- var Ctor = object.constructor;
975
- switch (tag) {
976
- case arrayBufferTag: return cloneArrayBuffer(object);
977
- case boolTag:
978
- case dateTag: return new Ctor(+object);
979
- case dataViewTag: return cloneDataView(object, isDeep);
980
- case float32Tag:
981
- case float64Tag:
982
- case int8Tag:
983
- case int16Tag:
984
- case int32Tag:
985
- case uint8Tag:
986
- case uint8ClampedTag:
987
- case uint16Tag:
988
- case uint32Tag: return cloneTypedArray(object, isDeep);
989
- case mapTag: return cloneMap(object, isDeep, cloneFunc);
990
- case numberTag:
991
- case stringTag: return new Ctor(object);
992
- case regexpTag: return cloneRegExp(object);
993
- case setTag: return cloneSet(object, isDeep, cloneFunc);
994
- case symbolTag: return cloneSymbol(object);
995
- }
996
- }
997
- /**
998
- * Checks if `value` is a valid array-like index.
999
- *
1000
- * @private
1001
- * @param {*} value The value to check.
1002
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1003
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1004
- */
1005
- function isIndex(value, length) {
1006
- length = length == null ? MAX_SAFE_INTEGER : length;
1007
- return !!length && (typeof value == "number" || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
1008
- }
1009
- /**
1010
- * Checks if `value` is suitable for use as unique object key.
1011
- *
1012
- * @private
1013
- * @param {*} value The value to check.
1014
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1015
- */
1016
- function isKeyable(value) {
1017
- var type = typeof value;
1018
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
1019
- }
1020
- /**
1021
- * Checks if `func` has its source masked.
1022
- *
1023
- * @private
1024
- * @param {Function} func The function to check.
1025
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1026
- */
1027
- function isMasked(func) {
1028
- return !!maskSrcKey && maskSrcKey in func;
1029
- }
1030
- /**
1031
- * Checks if `value` is likely a prototype object.
1032
- *
1033
- * @private
1034
- * @param {*} value The value to check.
1035
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1036
- */
1037
- function isPrototype(value) {
1038
- var Ctor = value && value.constructor;
1039
- return value === (typeof Ctor == "function" && Ctor.prototype || objectProto);
1040
- }
1041
- /**
1042
- * Converts `func` to its source code.
1043
- *
1044
- * @private
1045
- * @param {Function} func The function to process.
1046
- * @returns {string} Returns the source code.
1047
- */
1048
- function toSource(func) {
1049
- if (func != null) {
1050
- try {
1051
- return funcToString.call(func);
1052
- } catch (e) {}
1053
- try {
1054
- return func + "";
1055
- } catch (e) {}
1056
- }
1057
- return "";
1058
- }
1059
- /**
1060
- * This method is like `_.clone` except that it recursively clones `value`.
1061
- *
1062
- * @static
1063
- * @memberOf _
1064
- * @since 1.0.0
1065
- * @category Lang
1066
- * @param {*} value The value to recursively clone.
1067
- * @returns {*} Returns the deep cloned value.
1068
- * @see _.clone
1069
- * @example
1070
- *
1071
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
1072
- *
1073
- * var deep = _.cloneDeep(objects);
1074
- * console.log(deep[0] === objects[0]);
1075
- * // => false
1076
- */
1077
- function cloneDeep(value) {
1078
- return baseClone(value, true, true);
1079
- }
1080
- /**
1081
- * Performs a
1082
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1083
- * comparison between two values to determine if they are equivalent.
1084
- *
1085
- * @static
1086
- * @memberOf _
1087
- * @since 4.0.0
1088
- * @category Lang
1089
- * @param {*} value The value to compare.
1090
- * @param {*} other The other value to compare.
1091
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1092
- * @example
1093
- *
1094
- * var object = { 'a': 1 };
1095
- * var other = { 'a': 1 };
1096
- *
1097
- * _.eq(object, object);
1098
- * // => true
1099
- *
1100
- * _.eq(object, other);
1101
- * // => false
1102
- *
1103
- * _.eq('a', 'a');
1104
- * // => true
1105
- *
1106
- * _.eq('a', Object('a'));
1107
- * // => false
1108
- *
1109
- * _.eq(NaN, NaN);
1110
- * // => true
1111
- */
1112
- function eq(value, other) {
1113
- return value === other || value !== value && other !== other;
1114
- }
1115
- /**
1116
- * Checks if `value` is likely an `arguments` object.
1117
- *
1118
- * @static
1119
- * @memberOf _
1120
- * @since 0.1.0
1121
- * @category Lang
1122
- * @param {*} value The value to check.
1123
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1124
- * else `false`.
1125
- * @example
1126
- *
1127
- * _.isArguments(function() { return arguments; }());
1128
- * // => true
1129
- *
1130
- * _.isArguments([1, 2, 3]);
1131
- * // => false
1132
- */
1133
- function isArguments(value) {
1134
- return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
1135
- }
1136
- /**
1137
- * Checks if `value` is classified as an `Array` object.
1138
- *
1139
- * @static
1140
- * @memberOf _
1141
- * @since 0.1.0
1142
- * @category Lang
1143
- * @param {*} value The value to check.
1144
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1145
- * @example
1146
- *
1147
- * _.isArray([1, 2, 3]);
1148
- * // => true
1149
- *
1150
- * _.isArray(document.body.children);
1151
- * // => false
1152
- *
1153
- * _.isArray('abc');
1154
- * // => false
1155
- *
1156
- * _.isArray(_.noop);
1157
- * // => false
1158
- */
1159
- var isArray = Array.isArray;
1160
- /**
1161
- * Checks if `value` is array-like. A value is considered array-like if it's
1162
- * not a function and has a `value.length` that's an integer greater than or
1163
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1164
- *
1165
- * @static
1166
- * @memberOf _
1167
- * @since 4.0.0
1168
- * @category Lang
1169
- * @param {*} value The value to check.
1170
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1171
- * @example
1172
- *
1173
- * _.isArrayLike([1, 2, 3]);
1174
- * // => true
1175
- *
1176
- * _.isArrayLike(document.body.children);
1177
- * // => true
1178
- *
1179
- * _.isArrayLike('abc');
1180
- * // => true
1181
- *
1182
- * _.isArrayLike(_.noop);
1183
- * // => false
1184
- */
1185
- function isArrayLike(value) {
1186
- return value != null && isLength(value.length) && !isFunction(value);
1187
- }
1188
- /**
1189
- * This method is like `_.isArrayLike` except that it also checks if `value`
1190
- * is an object.
1191
- *
1192
- * @static
1193
- * @memberOf _
1194
- * @since 4.0.0
1195
- * @category Lang
1196
- * @param {*} value The value to check.
1197
- * @returns {boolean} Returns `true` if `value` is an array-like object,
1198
- * else `false`.
1199
- * @example
1200
- *
1201
- * _.isArrayLikeObject([1, 2, 3]);
1202
- * // => true
1203
- *
1204
- * _.isArrayLikeObject(document.body.children);
1205
- * // => true
1206
- *
1207
- * _.isArrayLikeObject('abc');
1208
- * // => false
1209
- *
1210
- * _.isArrayLikeObject(_.noop);
1211
- * // => false
1212
- */
1213
- function isArrayLikeObject(value) {
1214
- return isObjectLike(value) && isArrayLike(value);
1215
- }
1216
- /**
1217
- * Checks if `value` is a buffer.
1218
- *
1219
- * @static
1220
- * @memberOf _
1221
- * @since 4.3.0
1222
- * @category Lang
1223
- * @param {*} value The value to check.
1224
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1225
- * @example
1226
- *
1227
- * _.isBuffer(new Buffer(2));
1228
- * // => true
1229
- *
1230
- * _.isBuffer(new Uint8Array(2));
1231
- * // => false
1232
- */
1233
- var isBuffer = nativeIsBuffer || stubFalse;
1234
- /**
1235
- * Checks if `value` is classified as a `Function` object.
1236
- *
1237
- * @static
1238
- * @memberOf _
1239
- * @since 0.1.0
1240
- * @category Lang
1241
- * @param {*} value The value to check.
1242
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1243
- * @example
1244
- *
1245
- * _.isFunction(_);
1246
- * // => true
1247
- *
1248
- * _.isFunction(/abc/);
1249
- * // => false
1250
- */
1251
- function isFunction(value) {
1252
- var tag = isObject(value) ? objectToString.call(value) : "";
1253
- return tag == funcTag || tag == genTag;
1254
- }
1255
- /**
1256
- * Checks if `value` is a valid array-like length.
1257
- *
1258
- * **Note:** This method is loosely based on
1259
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1260
- *
1261
- * @static
1262
- * @memberOf _
1263
- * @since 4.0.0
1264
- * @category Lang
1265
- * @param {*} value The value to check.
1266
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1267
- * @example
1268
- *
1269
- * _.isLength(3);
1270
- * // => true
1271
- *
1272
- * _.isLength(Number.MIN_VALUE);
1273
- * // => false
1274
- *
1275
- * _.isLength(Infinity);
1276
- * // => false
1277
- *
1278
- * _.isLength('3');
1279
- * // => false
1280
- */
1281
- function isLength(value) {
1282
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1283
- }
1284
- /**
1285
- * Checks if `value` is the
1286
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1287
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1288
- *
1289
- * @static
1290
- * @memberOf _
1291
- * @since 0.1.0
1292
- * @category Lang
1293
- * @param {*} value The value to check.
1294
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1295
- * @example
1296
- *
1297
- * _.isObject({});
1298
- * // => true
1299
- *
1300
- * _.isObject([1, 2, 3]);
1301
- * // => true
1302
- *
1303
- * _.isObject(_.noop);
1304
- * // => true
1305
- *
1306
- * _.isObject(null);
1307
- * // => false
1308
- */
1309
- function isObject(value) {
1310
- var type = typeof value;
1311
- return !!value && (type == "object" || type == "function");
1312
- }
1313
- /**
1314
- * Checks if `value` is object-like. A value is object-like if it's not `null`
1315
- * and has a `typeof` result of "object".
1316
- *
1317
- * @static
1318
- * @memberOf _
1319
- * @since 4.0.0
1320
- * @category Lang
1321
- * @param {*} value The value to check.
1322
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1323
- * @example
1324
- *
1325
- * _.isObjectLike({});
1326
- * // => true
1327
- *
1328
- * _.isObjectLike([1, 2, 3]);
1329
- * // => true
1330
- *
1331
- * _.isObjectLike(_.noop);
1332
- * // => false
1333
- *
1334
- * _.isObjectLike(null);
1335
- * // => false
1336
- */
1337
- function isObjectLike(value) {
1338
- return !!value && typeof value == "object";
1339
- }
1340
- /**
1341
- * Creates an array of the own enumerable property names of `object`.
1342
- *
1343
- * **Note:** Non-object values are coerced to objects. See the
1344
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1345
- * for more details.
1346
- *
1347
- * @static
1348
- * @since 0.1.0
1349
- * @memberOf _
1350
- * @category Object
1351
- * @param {Object} object The object to query.
1352
- * @returns {Array} Returns the array of property names.
1353
- * @example
1354
- *
1355
- * function Foo() {
1356
- * this.a = 1;
1357
- * this.b = 2;
1358
- * }
1359
- *
1360
- * Foo.prototype.c = 3;
1361
- *
1362
- * _.keys(new Foo);
1363
- * // => ['a', 'b'] (iteration order is not guaranteed)
1364
- *
1365
- * _.keys('hi');
1366
- * // => ['0', '1']
1367
- */
1368
- function keys(object) {
1369
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1370
- }
1371
- /**
1372
- * This method returns a new empty array.
1373
- *
1374
- * @static
1375
- * @memberOf _
1376
- * @since 4.13.0
1377
- * @category Util
1378
- * @returns {Array} Returns the new empty array.
1379
- * @example
1380
- *
1381
- * var arrays = _.times(2, _.stubArray);
1382
- *
1383
- * console.log(arrays);
1384
- * // => [[], []]
1385
- *
1386
- * console.log(arrays[0] === arrays[1]);
1387
- * // => false
1388
- */
1389
- function stubArray() {
1390
- return [];
1391
- }
1392
- /**
1393
- * This method returns `false`.
1394
- *
1395
- * @static
1396
- * @memberOf _
1397
- * @since 4.13.0
1398
- * @category Util
1399
- * @returns {boolean} Returns `false`.
1400
- * @example
1401
- *
1402
- * _.times(2, _.stubFalse);
1403
- * // => [false, false]
1404
- */
1405
- function stubFalse() {
1406
- return false;
1407
- }
1408
- module.exports = cloneDeep;
1409
- }));
1410
-
1411
- //#endregion
1412
- export { require_lodash as t };