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