@vertexvis/utils 0.23.1-testing.1 → 0.23.1-testing.2

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.
@@ -767,6 +767,51 @@ var mapper = /*#__PURE__*/Object.freeze({
767
767
  pickFirst: pickFirst
768
768
  });
769
769
 
770
+ // do not edit .js files directly - edit src/index.jst
771
+
772
+
773
+
774
+ var fastDeepEqual = function equal(a, b) {
775
+ if (a === b) return true;
776
+
777
+ if (a && b && typeof a == 'object' && typeof b == 'object') {
778
+ if (a.constructor !== b.constructor) return false;
779
+
780
+ var length, i, keys;
781
+ if (Array.isArray(a)) {
782
+ length = a.length;
783
+ if (length != b.length) return false;
784
+ for (i = length; i-- !== 0;)
785
+ if (!equal(a[i], b[i])) return false;
786
+ return true;
787
+ }
788
+
789
+
790
+
791
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
792
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
793
+ if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
794
+
795
+ keys = Object.keys(a);
796
+ length = keys.length;
797
+ if (length !== Object.keys(b).length) return false;
798
+
799
+ for (i = length; i-- !== 0;)
800
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
801
+
802
+ for (i = length; i-- !== 0;) {
803
+ var key = keys[i];
804
+
805
+ if (!equal(a[key], b[key])) return false;
806
+ }
807
+
808
+ return true;
809
+ }
810
+
811
+ // true if both NaN, false otherwise
812
+ return a!==a && b!==b;
813
+ };
814
+
770
815
  /*!
771
816
  * isobject <https://github.com/jonschlinkert/isobject>
772
817
  *
@@ -812,1863 +857,6 @@ function isPlainObject$1(o) {
812
857
  return true;
813
858
  }
814
859
 
815
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
816
-
817
- var lodash_isequal = {exports: {}};
818
-
819
- /**
820
- * Lodash (Custom Build) <https://lodash.com/>
821
- * Build: `lodash modularize exports="npm" -o ./`
822
- * Copyright JS Foundation and other contributors <https://js.foundation/>
823
- * Released under MIT license <https://lodash.com/license>
824
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
825
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
826
- */
827
-
828
- (function (module, exports) {
829
- /** Used as the size to enable large array optimizations. */
830
- var LARGE_ARRAY_SIZE = 200;
831
-
832
- /** Used to stand-in for `undefined` hash values. */
833
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
834
-
835
- /** Used to compose bitmasks for value comparisons. */
836
- var COMPARE_PARTIAL_FLAG = 1,
837
- COMPARE_UNORDERED_FLAG = 2;
838
-
839
- /** Used as references for various `Number` constants. */
840
- var MAX_SAFE_INTEGER = 9007199254740991;
841
-
842
- /** `Object#toString` result references. */
843
- var argsTag = '[object Arguments]',
844
- arrayTag = '[object Array]',
845
- asyncTag = '[object AsyncFunction]',
846
- boolTag = '[object Boolean]',
847
- dateTag = '[object Date]',
848
- errorTag = '[object Error]',
849
- funcTag = '[object Function]',
850
- genTag = '[object GeneratorFunction]',
851
- mapTag = '[object Map]',
852
- numberTag = '[object Number]',
853
- nullTag = '[object Null]',
854
- objectTag = '[object Object]',
855
- promiseTag = '[object Promise]',
856
- proxyTag = '[object Proxy]',
857
- regexpTag = '[object RegExp]',
858
- setTag = '[object Set]',
859
- stringTag = '[object String]',
860
- symbolTag = '[object Symbol]',
861
- undefinedTag = '[object Undefined]',
862
- weakMapTag = '[object WeakMap]';
863
-
864
- var arrayBufferTag = '[object ArrayBuffer]',
865
- dataViewTag = '[object DataView]',
866
- float32Tag = '[object Float32Array]',
867
- float64Tag = '[object Float64Array]',
868
- int8Tag = '[object Int8Array]',
869
- int16Tag = '[object Int16Array]',
870
- int32Tag = '[object Int32Array]',
871
- uint8Tag = '[object Uint8Array]',
872
- uint8ClampedTag = '[object Uint8ClampedArray]',
873
- uint16Tag = '[object Uint16Array]',
874
- uint32Tag = '[object Uint32Array]';
875
-
876
- /**
877
- * Used to match `RegExp`
878
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
879
- */
880
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
881
-
882
- /** Used to detect host constructors (Safari). */
883
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
884
-
885
- /** Used to detect unsigned integer values. */
886
- var reIsUint = /^(?:0|[1-9]\d*)$/;
887
-
888
- /** Used to identify `toStringTag` values of typed arrays. */
889
- var typedArrayTags = {};
890
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
891
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
892
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
893
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
894
- typedArrayTags[uint32Tag] = true;
895
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
896
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
897
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
898
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
899
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
900
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
901
- typedArrayTags[setTag] = typedArrayTags[stringTag] =
902
- typedArrayTags[weakMapTag] = false;
903
-
904
- /** Detect free variable `global` from Node.js. */
905
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
906
-
907
- /** Detect free variable `self`. */
908
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
909
-
910
- /** Used as a reference to the global object. */
911
- var root = freeGlobal || freeSelf || Function('return this')();
912
-
913
- /** Detect free variable `exports`. */
914
- var freeExports = exports && !exports.nodeType && exports;
915
-
916
- /** Detect free variable `module`. */
917
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
918
-
919
- /** Detect the popular CommonJS extension `module.exports`. */
920
- var moduleExports = freeModule && freeModule.exports === freeExports;
921
-
922
- /** Detect free variable `process` from Node.js. */
923
- var freeProcess = moduleExports && freeGlobal.process;
924
-
925
- /** Used to access faster Node.js helpers. */
926
- var nodeUtil = (function() {
927
- try {
928
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
929
- } catch (e) {}
930
- }());
931
-
932
- /* Node.js helper references. */
933
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
934
-
935
- /**
936
- * A specialized version of `_.filter` for arrays without support for
937
- * iteratee shorthands.
938
- *
939
- * @private
940
- * @param {Array} [array] The array to iterate over.
941
- * @param {Function} predicate The function invoked per iteration.
942
- * @returns {Array} Returns the new filtered array.
943
- */
944
- function arrayFilter(array, predicate) {
945
- var index = -1,
946
- length = array == null ? 0 : array.length,
947
- resIndex = 0,
948
- result = [];
949
-
950
- while (++index < length) {
951
- var value = array[index];
952
- if (predicate(value, index, array)) {
953
- result[resIndex++] = value;
954
- }
955
- }
956
- return result;
957
- }
958
-
959
- /**
960
- * Appends the elements of `values` to `array`.
961
- *
962
- * @private
963
- * @param {Array} array The array to modify.
964
- * @param {Array} values The values to append.
965
- * @returns {Array} Returns `array`.
966
- */
967
- function arrayPush(array, values) {
968
- var index = -1,
969
- length = values.length,
970
- offset = array.length;
971
-
972
- while (++index < length) {
973
- array[offset + index] = values[index];
974
- }
975
- return array;
976
- }
977
-
978
- /**
979
- * A specialized version of `_.some` for arrays without support for iteratee
980
- * shorthands.
981
- *
982
- * @private
983
- * @param {Array} [array] The array to iterate over.
984
- * @param {Function} predicate The function invoked per iteration.
985
- * @returns {boolean} Returns `true` if any element passes the predicate check,
986
- * else `false`.
987
- */
988
- function arraySome(array, predicate) {
989
- var index = -1,
990
- length = array == null ? 0 : array.length;
991
-
992
- while (++index < length) {
993
- if (predicate(array[index], index, array)) {
994
- return true;
995
- }
996
- }
997
- return false;
998
- }
999
-
1000
- /**
1001
- * The base implementation of `_.times` without support for iteratee shorthands
1002
- * or max array length checks.
1003
- *
1004
- * @private
1005
- * @param {number} n The number of times to invoke `iteratee`.
1006
- * @param {Function} iteratee The function invoked per iteration.
1007
- * @returns {Array} Returns the array of results.
1008
- */
1009
- function baseTimes(n, iteratee) {
1010
- var index = -1,
1011
- result = Array(n);
1012
-
1013
- while (++index < n) {
1014
- result[index] = iteratee(index);
1015
- }
1016
- return result;
1017
- }
1018
-
1019
- /**
1020
- * The base implementation of `_.unary` without support for storing metadata.
1021
- *
1022
- * @private
1023
- * @param {Function} func The function to cap arguments for.
1024
- * @returns {Function} Returns the new capped function.
1025
- */
1026
- function baseUnary(func) {
1027
- return function(value) {
1028
- return func(value);
1029
- };
1030
- }
1031
-
1032
- /**
1033
- * Checks if a `cache` value for `key` exists.
1034
- *
1035
- * @private
1036
- * @param {Object} cache The cache to query.
1037
- * @param {string} key The key of the entry to check.
1038
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1039
- */
1040
- function cacheHas(cache, key) {
1041
- return cache.has(key);
1042
- }
1043
-
1044
- /**
1045
- * Gets the value at `key` of `object`.
1046
- *
1047
- * @private
1048
- * @param {Object} [object] The object to query.
1049
- * @param {string} key The key of the property to get.
1050
- * @returns {*} Returns the property value.
1051
- */
1052
- function getValue(object, key) {
1053
- return object == null ? undefined : object[key];
1054
- }
1055
-
1056
- /**
1057
- * Converts `map` to its key-value pairs.
1058
- *
1059
- * @private
1060
- * @param {Object} map The map to convert.
1061
- * @returns {Array} Returns the key-value pairs.
1062
- */
1063
- function mapToArray(map) {
1064
- var index = -1,
1065
- result = Array(map.size);
1066
-
1067
- map.forEach(function(value, key) {
1068
- result[++index] = [key, value];
1069
- });
1070
- return result;
1071
- }
1072
-
1073
- /**
1074
- * Creates a unary function that invokes `func` with its argument transformed.
1075
- *
1076
- * @private
1077
- * @param {Function} func The function to wrap.
1078
- * @param {Function} transform The argument transform.
1079
- * @returns {Function} Returns the new function.
1080
- */
1081
- function overArg(func, transform) {
1082
- return function(arg) {
1083
- return func(transform(arg));
1084
- };
1085
- }
1086
-
1087
- /**
1088
- * Converts `set` to an array of its values.
1089
- *
1090
- * @private
1091
- * @param {Object} set The set to convert.
1092
- * @returns {Array} Returns the values.
1093
- */
1094
- function setToArray(set) {
1095
- var index = -1,
1096
- result = Array(set.size);
1097
-
1098
- set.forEach(function(value) {
1099
- result[++index] = value;
1100
- });
1101
- return result;
1102
- }
1103
-
1104
- /** Used for built-in method references. */
1105
- var arrayProto = Array.prototype,
1106
- funcProto = Function.prototype,
1107
- objectProto = Object.prototype;
1108
-
1109
- /** Used to detect overreaching core-js shims. */
1110
- var coreJsData = root['__core-js_shared__'];
1111
-
1112
- /** Used to resolve the decompiled source of functions. */
1113
- var funcToString = funcProto.toString;
1114
-
1115
- /** Used to check objects for own properties. */
1116
- var hasOwnProperty = objectProto.hasOwnProperty;
1117
-
1118
- /** Used to detect methods masquerading as native. */
1119
- var maskSrcKey = (function() {
1120
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
1121
- return uid ? ('Symbol(src)_1.' + uid) : '';
1122
- }());
1123
-
1124
- /**
1125
- * Used to resolve the
1126
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1127
- * of values.
1128
- */
1129
- var nativeObjectToString = objectProto.toString;
1130
-
1131
- /** Used to detect if a method is native. */
1132
- var reIsNative = RegExp('^' +
1133
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
1134
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
1135
- );
1136
-
1137
- /** Built-in value references. */
1138
- var Buffer = moduleExports ? root.Buffer : undefined,
1139
- Symbol = root.Symbol,
1140
- Uint8Array = root.Uint8Array,
1141
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
1142
- splice = arrayProto.splice,
1143
- symToStringTag = Symbol ? Symbol.toStringTag : undefined;
1144
-
1145
- /* Built-in method references for those with the same name as other `lodash` methods. */
1146
- var nativeGetSymbols = Object.getOwnPropertySymbols,
1147
- nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
1148
- nativeKeys = overArg(Object.keys, Object);
1149
-
1150
- /* Built-in method references that are verified to be native. */
1151
- var DataView = getNative(root, 'DataView'),
1152
- Map = getNative(root, 'Map'),
1153
- Promise = getNative(root, 'Promise'),
1154
- Set = getNative(root, 'Set'),
1155
- WeakMap = getNative(root, 'WeakMap'),
1156
- nativeCreate = getNative(Object, 'create');
1157
-
1158
- /** Used to detect maps, sets, and weakmaps. */
1159
- var dataViewCtorString = toSource(DataView),
1160
- mapCtorString = toSource(Map),
1161
- promiseCtorString = toSource(Promise),
1162
- setCtorString = toSource(Set),
1163
- weakMapCtorString = toSource(WeakMap);
1164
-
1165
- /** Used to convert symbols to primitives and strings. */
1166
- var symbolProto = Symbol ? Symbol.prototype : undefined,
1167
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
1168
-
1169
- /**
1170
- * Creates a hash object.
1171
- *
1172
- * @private
1173
- * @constructor
1174
- * @param {Array} [entries] The key-value pairs to cache.
1175
- */
1176
- function Hash(entries) {
1177
- var index = -1,
1178
- length = entries == null ? 0 : entries.length;
1179
-
1180
- this.clear();
1181
- while (++index < length) {
1182
- var entry = entries[index];
1183
- this.set(entry[0], entry[1]);
1184
- }
1185
- }
1186
-
1187
- /**
1188
- * Removes all key-value entries from the hash.
1189
- *
1190
- * @private
1191
- * @name clear
1192
- * @memberOf Hash
1193
- */
1194
- function hashClear() {
1195
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
1196
- this.size = 0;
1197
- }
1198
-
1199
- /**
1200
- * Removes `key` and its value from the hash.
1201
- *
1202
- * @private
1203
- * @name delete
1204
- * @memberOf Hash
1205
- * @param {Object} hash The hash to modify.
1206
- * @param {string} key The key of the value to remove.
1207
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1208
- */
1209
- function hashDelete(key) {
1210
- var result = this.has(key) && delete this.__data__[key];
1211
- this.size -= result ? 1 : 0;
1212
- return result;
1213
- }
1214
-
1215
- /**
1216
- * Gets the hash value for `key`.
1217
- *
1218
- * @private
1219
- * @name get
1220
- * @memberOf Hash
1221
- * @param {string} key The key of the value to get.
1222
- * @returns {*} Returns the entry value.
1223
- */
1224
- function hashGet(key) {
1225
- var data = this.__data__;
1226
- if (nativeCreate) {
1227
- var result = data[key];
1228
- return result === HASH_UNDEFINED ? undefined : result;
1229
- }
1230
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
1231
- }
1232
-
1233
- /**
1234
- * Checks if a hash value for `key` exists.
1235
- *
1236
- * @private
1237
- * @name has
1238
- * @memberOf Hash
1239
- * @param {string} key The key of the entry to check.
1240
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1241
- */
1242
- function hashHas(key) {
1243
- var data = this.__data__;
1244
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
1245
- }
1246
-
1247
- /**
1248
- * Sets the hash `key` to `value`.
1249
- *
1250
- * @private
1251
- * @name set
1252
- * @memberOf Hash
1253
- * @param {string} key The key of the value to set.
1254
- * @param {*} value The value to set.
1255
- * @returns {Object} Returns the hash instance.
1256
- */
1257
- function hashSet(key, value) {
1258
- var data = this.__data__;
1259
- this.size += this.has(key) ? 0 : 1;
1260
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
1261
- return this;
1262
- }
1263
-
1264
- // Add methods to `Hash`.
1265
- Hash.prototype.clear = hashClear;
1266
- Hash.prototype['delete'] = hashDelete;
1267
- Hash.prototype.get = hashGet;
1268
- Hash.prototype.has = hashHas;
1269
- Hash.prototype.set = hashSet;
1270
-
1271
- /**
1272
- * Creates an list cache object.
1273
- *
1274
- * @private
1275
- * @constructor
1276
- * @param {Array} [entries] The key-value pairs to cache.
1277
- */
1278
- function ListCache(entries) {
1279
- var index = -1,
1280
- length = entries == null ? 0 : entries.length;
1281
-
1282
- this.clear();
1283
- while (++index < length) {
1284
- var entry = entries[index];
1285
- this.set(entry[0], entry[1]);
1286
- }
1287
- }
1288
-
1289
- /**
1290
- * Removes all key-value entries from the list cache.
1291
- *
1292
- * @private
1293
- * @name clear
1294
- * @memberOf ListCache
1295
- */
1296
- function listCacheClear() {
1297
- this.__data__ = [];
1298
- this.size = 0;
1299
- }
1300
-
1301
- /**
1302
- * Removes `key` and its value from the list cache.
1303
- *
1304
- * @private
1305
- * @name delete
1306
- * @memberOf ListCache
1307
- * @param {string} key The key of the value to remove.
1308
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1309
- */
1310
- function listCacheDelete(key) {
1311
- var data = this.__data__,
1312
- index = assocIndexOf(data, key);
1313
-
1314
- if (index < 0) {
1315
- return false;
1316
- }
1317
- var lastIndex = data.length - 1;
1318
- if (index == lastIndex) {
1319
- data.pop();
1320
- } else {
1321
- splice.call(data, index, 1);
1322
- }
1323
- --this.size;
1324
- return true;
1325
- }
1326
-
1327
- /**
1328
- * Gets the list cache value for `key`.
1329
- *
1330
- * @private
1331
- * @name get
1332
- * @memberOf ListCache
1333
- * @param {string} key The key of the value to get.
1334
- * @returns {*} Returns the entry value.
1335
- */
1336
- function listCacheGet(key) {
1337
- var data = this.__data__,
1338
- index = assocIndexOf(data, key);
1339
-
1340
- return index < 0 ? undefined : data[index][1];
1341
- }
1342
-
1343
- /**
1344
- * Checks if a list cache value for `key` exists.
1345
- *
1346
- * @private
1347
- * @name has
1348
- * @memberOf ListCache
1349
- * @param {string} key The key of the entry to check.
1350
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1351
- */
1352
- function listCacheHas(key) {
1353
- return assocIndexOf(this.__data__, key) > -1;
1354
- }
1355
-
1356
- /**
1357
- * Sets the list cache `key` to `value`.
1358
- *
1359
- * @private
1360
- * @name set
1361
- * @memberOf ListCache
1362
- * @param {string} key The key of the value to set.
1363
- * @param {*} value The value to set.
1364
- * @returns {Object} Returns the list cache instance.
1365
- */
1366
- function listCacheSet(key, value) {
1367
- var data = this.__data__,
1368
- index = assocIndexOf(data, key);
1369
-
1370
- if (index < 0) {
1371
- ++this.size;
1372
- data.push([key, value]);
1373
- } else {
1374
- data[index][1] = value;
1375
- }
1376
- return this;
1377
- }
1378
-
1379
- // Add methods to `ListCache`.
1380
- ListCache.prototype.clear = listCacheClear;
1381
- ListCache.prototype['delete'] = listCacheDelete;
1382
- ListCache.prototype.get = listCacheGet;
1383
- ListCache.prototype.has = listCacheHas;
1384
- ListCache.prototype.set = listCacheSet;
1385
-
1386
- /**
1387
- * Creates a map cache object to store key-value pairs.
1388
- *
1389
- * @private
1390
- * @constructor
1391
- * @param {Array} [entries] The key-value pairs to cache.
1392
- */
1393
- function MapCache(entries) {
1394
- var index = -1,
1395
- length = entries == null ? 0 : entries.length;
1396
-
1397
- this.clear();
1398
- while (++index < length) {
1399
- var entry = entries[index];
1400
- this.set(entry[0], entry[1]);
1401
- }
1402
- }
1403
-
1404
- /**
1405
- * Removes all key-value entries from the map.
1406
- *
1407
- * @private
1408
- * @name clear
1409
- * @memberOf MapCache
1410
- */
1411
- function mapCacheClear() {
1412
- this.size = 0;
1413
- this.__data__ = {
1414
- 'hash': new Hash,
1415
- 'map': new (Map || ListCache),
1416
- 'string': new Hash
1417
- };
1418
- }
1419
-
1420
- /**
1421
- * Removes `key` and its value from the map.
1422
- *
1423
- * @private
1424
- * @name delete
1425
- * @memberOf MapCache
1426
- * @param {string} key The key of the value to remove.
1427
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1428
- */
1429
- function mapCacheDelete(key) {
1430
- var result = getMapData(this, key)['delete'](key);
1431
- this.size -= result ? 1 : 0;
1432
- return result;
1433
- }
1434
-
1435
- /**
1436
- * Gets the map value for `key`.
1437
- *
1438
- * @private
1439
- * @name get
1440
- * @memberOf MapCache
1441
- * @param {string} key The key of the value to get.
1442
- * @returns {*} Returns the entry value.
1443
- */
1444
- function mapCacheGet(key) {
1445
- return getMapData(this, key).get(key);
1446
- }
1447
-
1448
- /**
1449
- * Checks if a map value for `key` exists.
1450
- *
1451
- * @private
1452
- * @name has
1453
- * @memberOf MapCache
1454
- * @param {string} key The key of the entry to check.
1455
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1456
- */
1457
- function mapCacheHas(key) {
1458
- return getMapData(this, key).has(key);
1459
- }
1460
-
1461
- /**
1462
- * Sets the map `key` to `value`.
1463
- *
1464
- * @private
1465
- * @name set
1466
- * @memberOf MapCache
1467
- * @param {string} key The key of the value to set.
1468
- * @param {*} value The value to set.
1469
- * @returns {Object} Returns the map cache instance.
1470
- */
1471
- function mapCacheSet(key, value) {
1472
- var data = getMapData(this, key),
1473
- size = data.size;
1474
-
1475
- data.set(key, value);
1476
- this.size += data.size == size ? 0 : 1;
1477
- return this;
1478
- }
1479
-
1480
- // Add methods to `MapCache`.
1481
- MapCache.prototype.clear = mapCacheClear;
1482
- MapCache.prototype['delete'] = mapCacheDelete;
1483
- MapCache.prototype.get = mapCacheGet;
1484
- MapCache.prototype.has = mapCacheHas;
1485
- MapCache.prototype.set = mapCacheSet;
1486
-
1487
- /**
1488
- *
1489
- * Creates an array cache object to store unique values.
1490
- *
1491
- * @private
1492
- * @constructor
1493
- * @param {Array} [values] The values to cache.
1494
- */
1495
- function SetCache(values) {
1496
- var index = -1,
1497
- length = values == null ? 0 : values.length;
1498
-
1499
- this.__data__ = new MapCache;
1500
- while (++index < length) {
1501
- this.add(values[index]);
1502
- }
1503
- }
1504
-
1505
- /**
1506
- * Adds `value` to the array cache.
1507
- *
1508
- * @private
1509
- * @name add
1510
- * @memberOf SetCache
1511
- * @alias push
1512
- * @param {*} value The value to cache.
1513
- * @returns {Object} Returns the cache instance.
1514
- */
1515
- function setCacheAdd(value) {
1516
- this.__data__.set(value, HASH_UNDEFINED);
1517
- return this;
1518
- }
1519
-
1520
- /**
1521
- * Checks if `value` is in the array cache.
1522
- *
1523
- * @private
1524
- * @name has
1525
- * @memberOf SetCache
1526
- * @param {*} value The value to search for.
1527
- * @returns {number} Returns `true` if `value` is found, else `false`.
1528
- */
1529
- function setCacheHas(value) {
1530
- return this.__data__.has(value);
1531
- }
1532
-
1533
- // Add methods to `SetCache`.
1534
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
1535
- SetCache.prototype.has = setCacheHas;
1536
-
1537
- /**
1538
- * Creates a stack cache object to store key-value pairs.
1539
- *
1540
- * @private
1541
- * @constructor
1542
- * @param {Array} [entries] The key-value pairs to cache.
1543
- */
1544
- function Stack(entries) {
1545
- var data = this.__data__ = new ListCache(entries);
1546
- this.size = data.size;
1547
- }
1548
-
1549
- /**
1550
- * Removes all key-value entries from the stack.
1551
- *
1552
- * @private
1553
- * @name clear
1554
- * @memberOf Stack
1555
- */
1556
- function stackClear() {
1557
- this.__data__ = new ListCache;
1558
- this.size = 0;
1559
- }
1560
-
1561
- /**
1562
- * Removes `key` and its value from the stack.
1563
- *
1564
- * @private
1565
- * @name delete
1566
- * @memberOf Stack
1567
- * @param {string} key The key of the value to remove.
1568
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1569
- */
1570
- function stackDelete(key) {
1571
- var data = this.__data__,
1572
- result = data['delete'](key);
1573
-
1574
- this.size = data.size;
1575
- return result;
1576
- }
1577
-
1578
- /**
1579
- * Gets the stack value for `key`.
1580
- *
1581
- * @private
1582
- * @name get
1583
- * @memberOf Stack
1584
- * @param {string} key The key of the value to get.
1585
- * @returns {*} Returns the entry value.
1586
- */
1587
- function stackGet(key) {
1588
- return this.__data__.get(key);
1589
- }
1590
-
1591
- /**
1592
- * Checks if a stack value for `key` exists.
1593
- *
1594
- * @private
1595
- * @name has
1596
- * @memberOf Stack
1597
- * @param {string} key The key of the entry to check.
1598
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1599
- */
1600
- function stackHas(key) {
1601
- return this.__data__.has(key);
1602
- }
1603
-
1604
- /**
1605
- * Sets the stack `key` to `value`.
1606
- *
1607
- * @private
1608
- * @name set
1609
- * @memberOf Stack
1610
- * @param {string} key The key of the value to set.
1611
- * @param {*} value The value to set.
1612
- * @returns {Object} Returns the stack cache instance.
1613
- */
1614
- function stackSet(key, value) {
1615
- var data = this.__data__;
1616
- if (data instanceof ListCache) {
1617
- var pairs = data.__data__;
1618
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
1619
- pairs.push([key, value]);
1620
- this.size = ++data.size;
1621
- return this;
1622
- }
1623
- data = this.__data__ = new MapCache(pairs);
1624
- }
1625
- data.set(key, value);
1626
- this.size = data.size;
1627
- return this;
1628
- }
1629
-
1630
- // Add methods to `Stack`.
1631
- Stack.prototype.clear = stackClear;
1632
- Stack.prototype['delete'] = stackDelete;
1633
- Stack.prototype.get = stackGet;
1634
- Stack.prototype.has = stackHas;
1635
- Stack.prototype.set = stackSet;
1636
-
1637
- /**
1638
- * Creates an array of the enumerable property names of the array-like `value`.
1639
- *
1640
- * @private
1641
- * @param {*} value The value to query.
1642
- * @param {boolean} inherited Specify returning inherited property names.
1643
- * @returns {Array} Returns the array of property names.
1644
- */
1645
- function arrayLikeKeys(value, inherited) {
1646
- var isArr = isArray(value),
1647
- isArg = !isArr && isArguments(value),
1648
- isBuff = !isArr && !isArg && isBuffer(value),
1649
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
1650
- skipIndexes = isArr || isArg || isBuff || isType,
1651
- result = skipIndexes ? baseTimes(value.length, String) : [],
1652
- length = result.length;
1653
-
1654
- for (var key in value) {
1655
- if ((inherited || hasOwnProperty.call(value, key)) &&
1656
- !(skipIndexes && (
1657
- // Safari 9 has enumerable `arguments.length` in strict mode.
1658
- key == 'length' ||
1659
- // Node.js 0.10 has enumerable non-index properties on buffers.
1660
- (isBuff && (key == 'offset' || key == 'parent')) ||
1661
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
1662
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
1663
- // Skip index properties.
1664
- isIndex(key, length)
1665
- ))) {
1666
- result.push(key);
1667
- }
1668
- }
1669
- return result;
1670
- }
1671
-
1672
- /**
1673
- * Gets the index at which the `key` is found in `array` of key-value pairs.
1674
- *
1675
- * @private
1676
- * @param {Array} array The array to inspect.
1677
- * @param {*} key The key to search for.
1678
- * @returns {number} Returns the index of the matched value, else `-1`.
1679
- */
1680
- function assocIndexOf(array, key) {
1681
- var length = array.length;
1682
- while (length--) {
1683
- if (eq(array[length][0], key)) {
1684
- return length;
1685
- }
1686
- }
1687
- return -1;
1688
- }
1689
-
1690
- /**
1691
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1692
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1693
- * symbols of `object`.
1694
- *
1695
- * @private
1696
- * @param {Object} object The object to query.
1697
- * @param {Function} keysFunc The function to get the keys of `object`.
1698
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
1699
- * @returns {Array} Returns the array of property names and symbols.
1700
- */
1701
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1702
- var result = keysFunc(object);
1703
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
1704
- }
1705
-
1706
- /**
1707
- * The base implementation of `getTag` without fallbacks for buggy environments.
1708
- *
1709
- * @private
1710
- * @param {*} value The value to query.
1711
- * @returns {string} Returns the `toStringTag`.
1712
- */
1713
- function baseGetTag(value) {
1714
- if (value == null) {
1715
- return value === undefined ? undefinedTag : nullTag;
1716
- }
1717
- return (symToStringTag && symToStringTag in Object(value))
1718
- ? getRawTag(value)
1719
- : objectToString(value);
1720
- }
1721
-
1722
- /**
1723
- * The base implementation of `_.isArguments`.
1724
- *
1725
- * @private
1726
- * @param {*} value The value to check.
1727
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1728
- */
1729
- function baseIsArguments(value) {
1730
- return isObjectLike(value) && baseGetTag(value) == argsTag;
1731
- }
1732
-
1733
- /**
1734
- * The base implementation of `_.isEqual` which supports partial comparisons
1735
- * and tracks traversed objects.
1736
- *
1737
- * @private
1738
- * @param {*} value The value to compare.
1739
- * @param {*} other The other value to compare.
1740
- * @param {boolean} bitmask The bitmask flags.
1741
- * 1 - Unordered comparison
1742
- * 2 - Partial comparison
1743
- * @param {Function} [customizer] The function to customize comparisons.
1744
- * @param {Object} [stack] Tracks traversed `value` and `other` objects.
1745
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1746
- */
1747
- function baseIsEqual(value, other, bitmask, customizer, stack) {
1748
- if (value === other) {
1749
- return true;
1750
- }
1751
- if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
1752
- return value !== value && other !== other;
1753
- }
1754
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
1755
- }
1756
-
1757
- /**
1758
- * A specialized version of `baseIsEqual` for arrays and objects which performs
1759
- * deep comparisons and tracks traversed objects enabling objects with circular
1760
- * references to be compared.
1761
- *
1762
- * @private
1763
- * @param {Object} object The object to compare.
1764
- * @param {Object} other The other object to compare.
1765
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1766
- * @param {Function} customizer The function to customize comparisons.
1767
- * @param {Function} equalFunc The function to determine equivalents of values.
1768
- * @param {Object} [stack] Tracks traversed `object` and `other` objects.
1769
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1770
- */
1771
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
1772
- var objIsArr = isArray(object),
1773
- othIsArr = isArray(other),
1774
- objTag = objIsArr ? arrayTag : getTag(object),
1775
- othTag = othIsArr ? arrayTag : getTag(other);
1776
-
1777
- objTag = objTag == argsTag ? objectTag : objTag;
1778
- othTag = othTag == argsTag ? objectTag : othTag;
1779
-
1780
- var objIsObj = objTag == objectTag,
1781
- othIsObj = othTag == objectTag,
1782
- isSameTag = objTag == othTag;
1783
-
1784
- if (isSameTag && isBuffer(object)) {
1785
- if (!isBuffer(other)) {
1786
- return false;
1787
- }
1788
- objIsArr = true;
1789
- objIsObj = false;
1790
- }
1791
- if (isSameTag && !objIsObj) {
1792
- stack || (stack = new Stack);
1793
- return (objIsArr || isTypedArray(object))
1794
- ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
1795
- : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
1796
- }
1797
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
1798
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
1799
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
1800
-
1801
- if (objIsWrapped || othIsWrapped) {
1802
- var objUnwrapped = objIsWrapped ? object.value() : object,
1803
- othUnwrapped = othIsWrapped ? other.value() : other;
1804
-
1805
- stack || (stack = new Stack);
1806
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
1807
- }
1808
- }
1809
- if (!isSameTag) {
1810
- return false;
1811
- }
1812
- stack || (stack = new Stack);
1813
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
1814
- }
1815
-
1816
- /**
1817
- * The base implementation of `_.isNative` without bad shim checks.
1818
- *
1819
- * @private
1820
- * @param {*} value The value to check.
1821
- * @returns {boolean} Returns `true` if `value` is a native function,
1822
- * else `false`.
1823
- */
1824
- function baseIsNative(value) {
1825
- if (!isObject(value) || isMasked(value)) {
1826
- return false;
1827
- }
1828
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
1829
- return pattern.test(toSource(value));
1830
- }
1831
-
1832
- /**
1833
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
1834
- *
1835
- * @private
1836
- * @param {*} value The value to check.
1837
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1838
- */
1839
- function baseIsTypedArray(value) {
1840
- return isObjectLike(value) &&
1841
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1842
- }
1843
-
1844
- /**
1845
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1846
- *
1847
- * @private
1848
- * @param {Object} object The object to query.
1849
- * @returns {Array} Returns the array of property names.
1850
- */
1851
- function baseKeys(object) {
1852
- if (!isPrototype(object)) {
1853
- return nativeKeys(object);
1854
- }
1855
- var result = [];
1856
- for (var key in Object(object)) {
1857
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
1858
- result.push(key);
1859
- }
1860
- }
1861
- return result;
1862
- }
1863
-
1864
- /**
1865
- * A specialized version of `baseIsEqualDeep` for arrays with support for
1866
- * partial deep comparisons.
1867
- *
1868
- * @private
1869
- * @param {Array} array The array to compare.
1870
- * @param {Array} other The other array to compare.
1871
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1872
- * @param {Function} customizer The function to customize comparisons.
1873
- * @param {Function} equalFunc The function to determine equivalents of values.
1874
- * @param {Object} stack Tracks traversed `array` and `other` objects.
1875
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1876
- */
1877
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1878
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
1879
- arrLength = array.length,
1880
- othLength = other.length;
1881
-
1882
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1883
- return false;
1884
- }
1885
- // Assume cyclic values are equal.
1886
- var stacked = stack.get(array);
1887
- if (stacked && stack.get(other)) {
1888
- return stacked == other;
1889
- }
1890
- var index = -1,
1891
- result = true,
1892
- seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
1893
-
1894
- stack.set(array, other);
1895
- stack.set(other, array);
1896
-
1897
- // Ignore non-index properties.
1898
- while (++index < arrLength) {
1899
- var arrValue = array[index],
1900
- othValue = other[index];
1901
-
1902
- if (customizer) {
1903
- var compared = isPartial
1904
- ? customizer(othValue, arrValue, index, other, array, stack)
1905
- : customizer(arrValue, othValue, index, array, other, stack);
1906
- }
1907
- if (compared !== undefined) {
1908
- if (compared) {
1909
- continue;
1910
- }
1911
- result = false;
1912
- break;
1913
- }
1914
- // Recursively compare arrays (susceptible to call stack limits).
1915
- if (seen) {
1916
- if (!arraySome(other, function(othValue, othIndex) {
1917
- if (!cacheHas(seen, othIndex) &&
1918
- (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1919
- return seen.push(othIndex);
1920
- }
1921
- })) {
1922
- result = false;
1923
- break;
1924
- }
1925
- } else if (!(
1926
- arrValue === othValue ||
1927
- equalFunc(arrValue, othValue, bitmask, customizer, stack)
1928
- )) {
1929
- result = false;
1930
- break;
1931
- }
1932
- }
1933
- stack['delete'](array);
1934
- stack['delete'](other);
1935
- return result;
1936
- }
1937
-
1938
- /**
1939
- * A specialized version of `baseIsEqualDeep` for comparing objects of
1940
- * the same `toStringTag`.
1941
- *
1942
- * **Note:** This function only supports comparing values with tags of
1943
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1944
- *
1945
- * @private
1946
- * @param {Object} object The object to compare.
1947
- * @param {Object} other The other object to compare.
1948
- * @param {string} tag The `toStringTag` of the objects to compare.
1949
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1950
- * @param {Function} customizer The function to customize comparisons.
1951
- * @param {Function} equalFunc The function to determine equivalents of values.
1952
- * @param {Object} stack Tracks traversed `object` and `other` objects.
1953
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1954
- */
1955
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1956
- switch (tag) {
1957
- case dataViewTag:
1958
- if ((object.byteLength != other.byteLength) ||
1959
- (object.byteOffset != other.byteOffset)) {
1960
- return false;
1961
- }
1962
- object = object.buffer;
1963
- other = other.buffer;
1964
-
1965
- case arrayBufferTag:
1966
- if ((object.byteLength != other.byteLength) ||
1967
- !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
1968
- return false;
1969
- }
1970
- return true;
1971
-
1972
- case boolTag:
1973
- case dateTag:
1974
- case numberTag:
1975
- // Coerce booleans to `1` or `0` and dates to milliseconds.
1976
- // Invalid dates are coerced to `NaN`.
1977
- return eq(+object, +other);
1978
-
1979
- case errorTag:
1980
- return object.name == other.name && object.message == other.message;
1981
-
1982
- case regexpTag:
1983
- case stringTag:
1984
- // Coerce regexes to strings and treat strings, primitives and objects,
1985
- // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1986
- // for more details.
1987
- return object == (other + '');
1988
-
1989
- case mapTag:
1990
- var convert = mapToArray;
1991
-
1992
- case setTag:
1993
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
1994
- convert || (convert = setToArray);
1995
-
1996
- if (object.size != other.size && !isPartial) {
1997
- return false;
1998
- }
1999
- // Assume cyclic values are equal.
2000
- var stacked = stack.get(object);
2001
- if (stacked) {
2002
- return stacked == other;
2003
- }
2004
- bitmask |= COMPARE_UNORDERED_FLAG;
2005
-
2006
- // Recursively compare objects (susceptible to call stack limits).
2007
- stack.set(object, other);
2008
- var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
2009
- stack['delete'](object);
2010
- return result;
2011
-
2012
- case symbolTag:
2013
- if (symbolValueOf) {
2014
- return symbolValueOf.call(object) == symbolValueOf.call(other);
2015
- }
2016
- }
2017
- return false;
2018
- }
2019
-
2020
- /**
2021
- * A specialized version of `baseIsEqualDeep` for objects with support for
2022
- * partial deep comparisons.
2023
- *
2024
- * @private
2025
- * @param {Object} object The object to compare.
2026
- * @param {Object} other The other object to compare.
2027
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
2028
- * @param {Function} customizer The function to customize comparisons.
2029
- * @param {Function} equalFunc The function to determine equivalents of values.
2030
- * @param {Object} stack Tracks traversed `object` and `other` objects.
2031
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
2032
- */
2033
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
2034
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
2035
- objProps = getAllKeys(object),
2036
- objLength = objProps.length,
2037
- othProps = getAllKeys(other),
2038
- othLength = othProps.length;
2039
-
2040
- if (objLength != othLength && !isPartial) {
2041
- return false;
2042
- }
2043
- var index = objLength;
2044
- while (index--) {
2045
- var key = objProps[index];
2046
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
2047
- return false;
2048
- }
2049
- }
2050
- // Assume cyclic values are equal.
2051
- var stacked = stack.get(object);
2052
- if (stacked && stack.get(other)) {
2053
- return stacked == other;
2054
- }
2055
- var result = true;
2056
- stack.set(object, other);
2057
- stack.set(other, object);
2058
-
2059
- var skipCtor = isPartial;
2060
- while (++index < objLength) {
2061
- key = objProps[index];
2062
- var objValue = object[key],
2063
- othValue = other[key];
2064
-
2065
- if (customizer) {
2066
- var compared = isPartial
2067
- ? customizer(othValue, objValue, key, other, object, stack)
2068
- : customizer(objValue, othValue, key, object, other, stack);
2069
- }
2070
- // Recursively compare objects (susceptible to call stack limits).
2071
- if (!(compared === undefined
2072
- ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
2073
- : compared
2074
- )) {
2075
- result = false;
2076
- break;
2077
- }
2078
- skipCtor || (skipCtor = key == 'constructor');
2079
- }
2080
- if (result && !skipCtor) {
2081
- var objCtor = object.constructor,
2082
- othCtor = other.constructor;
2083
-
2084
- // Non `Object` object instances with different constructors are not equal.
2085
- if (objCtor != othCtor &&
2086
- ('constructor' in object && 'constructor' in other) &&
2087
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
2088
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
2089
- result = false;
2090
- }
2091
- }
2092
- stack['delete'](object);
2093
- stack['delete'](other);
2094
- return result;
2095
- }
2096
-
2097
- /**
2098
- * Creates an array of own enumerable property names and symbols of `object`.
2099
- *
2100
- * @private
2101
- * @param {Object} object The object to query.
2102
- * @returns {Array} Returns the array of property names and symbols.
2103
- */
2104
- function getAllKeys(object) {
2105
- return baseGetAllKeys(object, keys, getSymbols);
2106
- }
2107
-
2108
- /**
2109
- * Gets the data for `map`.
2110
- *
2111
- * @private
2112
- * @param {Object} map The map to query.
2113
- * @param {string} key The reference key.
2114
- * @returns {*} Returns the map data.
2115
- */
2116
- function getMapData(map, key) {
2117
- var data = map.__data__;
2118
- return isKeyable(key)
2119
- ? data[typeof key == 'string' ? 'string' : 'hash']
2120
- : data.map;
2121
- }
2122
-
2123
- /**
2124
- * Gets the native function at `key` of `object`.
2125
- *
2126
- * @private
2127
- * @param {Object} object The object to query.
2128
- * @param {string} key The key of the method to get.
2129
- * @returns {*} Returns the function if it's native, else `undefined`.
2130
- */
2131
- function getNative(object, key) {
2132
- var value = getValue(object, key);
2133
- return baseIsNative(value) ? value : undefined;
2134
- }
2135
-
2136
- /**
2137
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
2138
- *
2139
- * @private
2140
- * @param {*} value The value to query.
2141
- * @returns {string} Returns the raw `toStringTag`.
2142
- */
2143
- function getRawTag(value) {
2144
- var isOwn = hasOwnProperty.call(value, symToStringTag),
2145
- tag = value[symToStringTag];
2146
-
2147
- try {
2148
- value[symToStringTag] = undefined;
2149
- var unmasked = true;
2150
- } catch (e) {}
2151
-
2152
- var result = nativeObjectToString.call(value);
2153
- if (unmasked) {
2154
- if (isOwn) {
2155
- value[symToStringTag] = tag;
2156
- } else {
2157
- delete value[symToStringTag];
2158
- }
2159
- }
2160
- return result;
2161
- }
2162
-
2163
- /**
2164
- * Creates an array of the own enumerable symbols of `object`.
2165
- *
2166
- * @private
2167
- * @param {Object} object The object to query.
2168
- * @returns {Array} Returns the array of symbols.
2169
- */
2170
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
2171
- if (object == null) {
2172
- return [];
2173
- }
2174
- object = Object(object);
2175
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
2176
- return propertyIsEnumerable.call(object, symbol);
2177
- });
2178
- };
2179
-
2180
- /**
2181
- * Gets the `toStringTag` of `value`.
2182
- *
2183
- * @private
2184
- * @param {*} value The value to query.
2185
- * @returns {string} Returns the `toStringTag`.
2186
- */
2187
- var getTag = baseGetTag;
2188
-
2189
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
2190
- if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
2191
- (Map && getTag(new Map) != mapTag) ||
2192
- (Promise && getTag(Promise.resolve()) != promiseTag) ||
2193
- (Set && getTag(new Set) != setTag) ||
2194
- (WeakMap && getTag(new WeakMap) != weakMapTag)) {
2195
- getTag = function(value) {
2196
- var result = baseGetTag(value),
2197
- Ctor = result == objectTag ? value.constructor : undefined,
2198
- ctorString = Ctor ? toSource(Ctor) : '';
2199
-
2200
- if (ctorString) {
2201
- switch (ctorString) {
2202
- case dataViewCtorString: return dataViewTag;
2203
- case mapCtorString: return mapTag;
2204
- case promiseCtorString: return promiseTag;
2205
- case setCtorString: return setTag;
2206
- case weakMapCtorString: return weakMapTag;
2207
- }
2208
- }
2209
- return result;
2210
- };
2211
- }
2212
-
2213
- /**
2214
- * Checks if `value` is a valid array-like index.
2215
- *
2216
- * @private
2217
- * @param {*} value The value to check.
2218
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
2219
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
2220
- */
2221
- function isIndex(value, length) {
2222
- length = length == null ? MAX_SAFE_INTEGER : length;
2223
- return !!length &&
2224
- (typeof value == 'number' || reIsUint.test(value)) &&
2225
- (value > -1 && value % 1 == 0 && value < length);
2226
- }
2227
-
2228
- /**
2229
- * Checks if `value` is suitable for use as unique object key.
2230
- *
2231
- * @private
2232
- * @param {*} value The value to check.
2233
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
2234
- */
2235
- function isKeyable(value) {
2236
- var type = typeof value;
2237
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
2238
- ? (value !== '__proto__')
2239
- : (value === null);
2240
- }
2241
-
2242
- /**
2243
- * Checks if `func` has its source masked.
2244
- *
2245
- * @private
2246
- * @param {Function} func The function to check.
2247
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
2248
- */
2249
- function isMasked(func) {
2250
- return !!maskSrcKey && (maskSrcKey in func);
2251
- }
2252
-
2253
- /**
2254
- * Checks if `value` is likely a prototype object.
2255
- *
2256
- * @private
2257
- * @param {*} value The value to check.
2258
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
2259
- */
2260
- function isPrototype(value) {
2261
- var Ctor = value && value.constructor,
2262
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
2263
-
2264
- return value === proto;
2265
- }
2266
-
2267
- /**
2268
- * Converts `value` to a string using `Object.prototype.toString`.
2269
- *
2270
- * @private
2271
- * @param {*} value The value to convert.
2272
- * @returns {string} Returns the converted string.
2273
- */
2274
- function objectToString(value) {
2275
- return nativeObjectToString.call(value);
2276
- }
2277
-
2278
- /**
2279
- * Converts `func` to its source code.
2280
- *
2281
- * @private
2282
- * @param {Function} func The function to convert.
2283
- * @returns {string} Returns the source code.
2284
- */
2285
- function toSource(func) {
2286
- if (func != null) {
2287
- try {
2288
- return funcToString.call(func);
2289
- } catch (e) {}
2290
- try {
2291
- return (func + '');
2292
- } catch (e) {}
2293
- }
2294
- return '';
2295
- }
2296
-
2297
- /**
2298
- * Performs a
2299
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
2300
- * comparison between two values to determine if they are equivalent.
2301
- *
2302
- * @static
2303
- * @memberOf _
2304
- * @since 4.0.0
2305
- * @category Lang
2306
- * @param {*} value The value to compare.
2307
- * @param {*} other The other value to compare.
2308
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2309
- * @example
2310
- *
2311
- * var object = { 'a': 1 };
2312
- * var other = { 'a': 1 };
2313
- *
2314
- * _.eq(object, object);
2315
- * // => true
2316
- *
2317
- * _.eq(object, other);
2318
- * // => false
2319
- *
2320
- * _.eq('a', 'a');
2321
- * // => true
2322
- *
2323
- * _.eq('a', Object('a'));
2324
- * // => false
2325
- *
2326
- * _.eq(NaN, NaN);
2327
- * // => true
2328
- */
2329
- function eq(value, other) {
2330
- return value === other || (value !== value && other !== other);
2331
- }
2332
-
2333
- /**
2334
- * Checks if `value` is likely an `arguments` object.
2335
- *
2336
- * @static
2337
- * @memberOf _
2338
- * @since 0.1.0
2339
- * @category Lang
2340
- * @param {*} value The value to check.
2341
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
2342
- * else `false`.
2343
- * @example
2344
- *
2345
- * _.isArguments(function() { return arguments; }());
2346
- * // => true
2347
- *
2348
- * _.isArguments([1, 2, 3]);
2349
- * // => false
2350
- */
2351
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
2352
- return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
2353
- !propertyIsEnumerable.call(value, 'callee');
2354
- };
2355
-
2356
- /**
2357
- * Checks if `value` is classified as an `Array` object.
2358
- *
2359
- * @static
2360
- * @memberOf _
2361
- * @since 0.1.0
2362
- * @category Lang
2363
- * @param {*} value The value to check.
2364
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
2365
- * @example
2366
- *
2367
- * _.isArray([1, 2, 3]);
2368
- * // => true
2369
- *
2370
- * _.isArray(document.body.children);
2371
- * // => false
2372
- *
2373
- * _.isArray('abc');
2374
- * // => false
2375
- *
2376
- * _.isArray(_.noop);
2377
- * // => false
2378
- */
2379
- var isArray = Array.isArray;
2380
-
2381
- /**
2382
- * Checks if `value` is array-like. A value is considered array-like if it's
2383
- * not a function and has a `value.length` that's an integer greater than or
2384
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
2385
- *
2386
- * @static
2387
- * @memberOf _
2388
- * @since 4.0.0
2389
- * @category Lang
2390
- * @param {*} value The value to check.
2391
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
2392
- * @example
2393
- *
2394
- * _.isArrayLike([1, 2, 3]);
2395
- * // => true
2396
- *
2397
- * _.isArrayLike(document.body.children);
2398
- * // => true
2399
- *
2400
- * _.isArrayLike('abc');
2401
- * // => true
2402
- *
2403
- * _.isArrayLike(_.noop);
2404
- * // => false
2405
- */
2406
- function isArrayLike(value) {
2407
- return value != null && isLength(value.length) && !isFunction(value);
2408
- }
2409
-
2410
- /**
2411
- * Checks if `value` is a buffer.
2412
- *
2413
- * @static
2414
- * @memberOf _
2415
- * @since 4.3.0
2416
- * @category Lang
2417
- * @param {*} value The value to check.
2418
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
2419
- * @example
2420
- *
2421
- * _.isBuffer(new Buffer(2));
2422
- * // => true
2423
- *
2424
- * _.isBuffer(new Uint8Array(2));
2425
- * // => false
2426
- */
2427
- var isBuffer = nativeIsBuffer || stubFalse;
2428
-
2429
- /**
2430
- * Performs a deep comparison between two values to determine if they are
2431
- * equivalent.
2432
- *
2433
- * **Note:** This method supports comparing arrays, array buffers, booleans,
2434
- * date objects, error objects, maps, numbers, `Object` objects, regexes,
2435
- * sets, strings, symbols, and typed arrays. `Object` objects are compared
2436
- * by their own, not inherited, enumerable properties. Functions and DOM
2437
- * nodes are compared by strict equality, i.e. `===`.
2438
- *
2439
- * @static
2440
- * @memberOf _
2441
- * @since 0.1.0
2442
- * @category Lang
2443
- * @param {*} value The value to compare.
2444
- * @param {*} other The other value to compare.
2445
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
2446
- * @example
2447
- *
2448
- * var object = { 'a': 1 };
2449
- * var other = { 'a': 1 };
2450
- *
2451
- * _.isEqual(object, other);
2452
- * // => true
2453
- *
2454
- * object === other;
2455
- * // => false
2456
- */
2457
- function isEqual(value, other) {
2458
- return baseIsEqual(value, other);
2459
- }
2460
-
2461
- /**
2462
- * Checks if `value` is classified as a `Function` object.
2463
- *
2464
- * @static
2465
- * @memberOf _
2466
- * @since 0.1.0
2467
- * @category Lang
2468
- * @param {*} value The value to check.
2469
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
2470
- * @example
2471
- *
2472
- * _.isFunction(_);
2473
- * // => true
2474
- *
2475
- * _.isFunction(/abc/);
2476
- * // => false
2477
- */
2478
- function isFunction(value) {
2479
- if (!isObject(value)) {
2480
- return false;
2481
- }
2482
- // The use of `Object#toString` avoids issues with the `typeof` operator
2483
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
2484
- var tag = baseGetTag(value);
2485
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
2486
- }
2487
-
2488
- /**
2489
- * Checks if `value` is a valid array-like length.
2490
- *
2491
- * **Note:** This method is loosely based on
2492
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
2493
- *
2494
- * @static
2495
- * @memberOf _
2496
- * @since 4.0.0
2497
- * @category Lang
2498
- * @param {*} value The value to check.
2499
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
2500
- * @example
2501
- *
2502
- * _.isLength(3);
2503
- * // => true
2504
- *
2505
- * _.isLength(Number.MIN_VALUE);
2506
- * // => false
2507
- *
2508
- * _.isLength(Infinity);
2509
- * // => false
2510
- *
2511
- * _.isLength('3');
2512
- * // => false
2513
- */
2514
- function isLength(value) {
2515
- return typeof value == 'number' &&
2516
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2517
- }
2518
-
2519
- /**
2520
- * Checks if `value` is the
2521
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
2522
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
2523
- *
2524
- * @static
2525
- * @memberOf _
2526
- * @since 0.1.0
2527
- * @category Lang
2528
- * @param {*} value The value to check.
2529
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
2530
- * @example
2531
- *
2532
- * _.isObject({});
2533
- * // => true
2534
- *
2535
- * _.isObject([1, 2, 3]);
2536
- * // => true
2537
- *
2538
- * _.isObject(_.noop);
2539
- * // => true
2540
- *
2541
- * _.isObject(null);
2542
- * // => false
2543
- */
2544
- function isObject(value) {
2545
- var type = typeof value;
2546
- return value != null && (type == 'object' || type == 'function');
2547
- }
2548
-
2549
- /**
2550
- * Checks if `value` is object-like. A value is object-like if it's not `null`
2551
- * and has a `typeof` result of "object".
2552
- *
2553
- * @static
2554
- * @memberOf _
2555
- * @since 4.0.0
2556
- * @category Lang
2557
- * @param {*} value The value to check.
2558
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
2559
- * @example
2560
- *
2561
- * _.isObjectLike({});
2562
- * // => true
2563
- *
2564
- * _.isObjectLike([1, 2, 3]);
2565
- * // => true
2566
- *
2567
- * _.isObjectLike(_.noop);
2568
- * // => false
2569
- *
2570
- * _.isObjectLike(null);
2571
- * // => false
2572
- */
2573
- function isObjectLike(value) {
2574
- return value != null && typeof value == 'object';
2575
- }
2576
-
2577
- /**
2578
- * Checks if `value` is classified as a typed array.
2579
- *
2580
- * @static
2581
- * @memberOf _
2582
- * @since 3.0.0
2583
- * @category Lang
2584
- * @param {*} value The value to check.
2585
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
2586
- * @example
2587
- *
2588
- * _.isTypedArray(new Uint8Array);
2589
- * // => true
2590
- *
2591
- * _.isTypedArray([]);
2592
- * // => false
2593
- */
2594
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
2595
-
2596
- /**
2597
- * Creates an array of the own enumerable property names of `object`.
2598
- *
2599
- * **Note:** Non-object values are coerced to objects. See the
2600
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
2601
- * for more details.
2602
- *
2603
- * @static
2604
- * @since 0.1.0
2605
- * @memberOf _
2606
- * @category Object
2607
- * @param {Object} object The object to query.
2608
- * @returns {Array} Returns the array of property names.
2609
- * @example
2610
- *
2611
- * function Foo() {
2612
- * this.a = 1;
2613
- * this.b = 2;
2614
- * }
2615
- *
2616
- * Foo.prototype.c = 3;
2617
- *
2618
- * _.keys(new Foo);
2619
- * // => ['a', 'b'] (iteration order is not guaranteed)
2620
- *
2621
- * _.keys('hi');
2622
- * // => ['0', '1']
2623
- */
2624
- function keys(object) {
2625
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
2626
- }
2627
-
2628
- /**
2629
- * This method returns a new empty array.
2630
- *
2631
- * @static
2632
- * @memberOf _
2633
- * @since 4.13.0
2634
- * @category Util
2635
- * @returns {Array} Returns the new empty array.
2636
- * @example
2637
- *
2638
- * var arrays = _.times(2, _.stubArray);
2639
- *
2640
- * console.log(arrays);
2641
- * // => [[], []]
2642
- *
2643
- * console.log(arrays[0] === arrays[1]);
2644
- * // => false
2645
- */
2646
- function stubArray() {
2647
- return [];
2648
- }
2649
-
2650
- /**
2651
- * This method returns `false`.
2652
- *
2653
- * @static
2654
- * @memberOf _
2655
- * @since 4.13.0
2656
- * @category Util
2657
- * @returns {boolean} Returns `false`.
2658
- * @example
2659
- *
2660
- * _.times(2, _.stubFalse);
2661
- * // => [false, false]
2662
- */
2663
- function stubFalse() {
2664
- return false;
2665
- }
2666
-
2667
- module.exports = isEqual;
2668
- }(lodash_isequal, lodash_isequal.exports));
2669
-
2670
- var areEqual = lodash_isequal.exports;
2671
-
2672
860
  function defaults() {
2673
861
  var objects = [];
2674
862
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -2733,7 +921,7 @@ function isPlainObject(obj) {
2733
921
  * @returns `true` if the two objects are equal. Otherwise `false`.
2734
922
  */
2735
923
  function isEqual$1(a, b) {
2736
- return areEqual(a, b);
924
+ return fastDeepEqual(a, b);
2737
925
  }
2738
926
  function toPairs(obj) {
2739
927
  if (obj != null) {