@pagenflow/email 1.4.1 → 1.4.3

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