@vertexvis/utils 0.23.2-canary.0 → 0.23.2-testing.0

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