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

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