@kato-lee/utilities 1.0.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.
- package/LICENSE +21 -0
- package/README.md +9 -0
- package/_either.d.ts +12 -0
- package/_group-by-key.d.ts +6 -0
- package/_lodash.d.ts +71 -0
- package/_path.d.ts +1 -0
- package/esm2022/_either.mjs +49 -0
- package/esm2022/_group-by-key.mjs +19 -0
- package/esm2022/_lodash.mjs +91 -0
- package/esm2022/_path.mjs +17 -0
- package/esm2022/index.mjs +8 -0
- package/esm2022/js/_clone-deep.mjs +619 -0
- package/esm2022/js/_order-by.mjs +948 -0
- package/esm2022/kato-lee-utilities.mjs +5 -0
- package/fesm2022/kato-lee-utilities.mjs +1749 -0
- package/fesm2022/kato-lee-utilities.mjs.map +1 -0
- package/index.d.ts +4 -0
- package/js/_clone-deep.d.ts +2 -0
- package/js/_clone-deep.js +826 -0
- package/js/_order-by.d.ts +2 -0
- package/js/_order-by.js +1287 -0
- package/js/index.js +2 -0
- package/package.json +18 -0
package/js/_order-by.js
ADDED
|
@@ -0,0 +1,1287 @@
|
|
|
1
|
+
let LARGE_ARRAY_SIZE = 200;
|
|
2
|
+
let FUNC_ERROR_TEXT = 'Expected a function';
|
|
3
|
+
let HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
4
|
+
let UNORDERED_COMPARE_FLAG = 1,
|
|
5
|
+
PARTIAL_COMPARE_FLAG = 2;
|
|
6
|
+
let INFINITY = 1 / 0,
|
|
7
|
+
MAX_SAFE_INTEGER = 9007199254740991;
|
|
8
|
+
|
|
9
|
+
let argsTag = '[object Arguments]',
|
|
10
|
+
arrayTag = '[object Array]',
|
|
11
|
+
boolTag = '[object Boolean]',
|
|
12
|
+
dateTag = '[object Date]',
|
|
13
|
+
errorTag = '[object Error]',
|
|
14
|
+
funcTag = '[object Function]',
|
|
15
|
+
genTag = '[object GeneratorFunction]',
|
|
16
|
+
mapTag = '[object Map]',
|
|
17
|
+
numberTag = '[object Number]',
|
|
18
|
+
objectTag = '[object Object]',
|
|
19
|
+
promiseTag = '[object Promise]',
|
|
20
|
+
regexpTag = '[object RegExp]',
|
|
21
|
+
setTag = '[object Set]',
|
|
22
|
+
stringTag = '[object String]',
|
|
23
|
+
symbolTag = '[object Symbol]',
|
|
24
|
+
weakMapTag = '[object WeakMap]';
|
|
25
|
+
|
|
26
|
+
let arrayBufferTag = '[object ArrayBuffer]',
|
|
27
|
+
dataViewTag = '[object DataView]',
|
|
28
|
+
float32Tag = '[object Float32Array]',
|
|
29
|
+
float64Tag = '[object Float64Array]',
|
|
30
|
+
int8Tag = '[object Int8Array]',
|
|
31
|
+
int16Tag = '[object Int16Array]',
|
|
32
|
+
int32Tag = '[object Int32Array]',
|
|
33
|
+
uint8Tag = '[object Uint8Array]',
|
|
34
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
35
|
+
uint16Tag = '[object Uint16Array]',
|
|
36
|
+
uint32Tag = '[object Uint32Array]';
|
|
37
|
+
|
|
38
|
+
let reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
39
|
+
reIsPlainProp = /^\w*$/,
|
|
40
|
+
reLeadingDot = /^\./,
|
|
41
|
+
rePropName =
|
|
42
|
+
/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
43
|
+
|
|
44
|
+
let reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
45
|
+
let reEscapeChar = /\\(\\)?/g;
|
|
46
|
+
let reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
47
|
+
let reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
48
|
+
|
|
49
|
+
let typedArrayTags = {};
|
|
50
|
+
typedArrayTags[float32Tag] =
|
|
51
|
+
typedArrayTags[float64Tag] =
|
|
52
|
+
typedArrayTags[int8Tag] =
|
|
53
|
+
typedArrayTags[int16Tag] =
|
|
54
|
+
typedArrayTags[int32Tag] =
|
|
55
|
+
typedArrayTags[uint8Tag] =
|
|
56
|
+
typedArrayTags[uint8ClampedTag] =
|
|
57
|
+
typedArrayTags[uint16Tag] =
|
|
58
|
+
typedArrayTags[uint32Tag] =
|
|
59
|
+
true;
|
|
60
|
+
typedArrayTags[argsTag] =
|
|
61
|
+
typedArrayTags[arrayTag] =
|
|
62
|
+
typedArrayTags[arrayBufferTag] =
|
|
63
|
+
typedArrayTags[boolTag] =
|
|
64
|
+
typedArrayTags[dataViewTag] =
|
|
65
|
+
typedArrayTags[dateTag] =
|
|
66
|
+
typedArrayTags[errorTag] =
|
|
67
|
+
typedArrayTags[funcTag] =
|
|
68
|
+
typedArrayTags[mapTag] =
|
|
69
|
+
typedArrayTags[numberTag] =
|
|
70
|
+
typedArrayTags[objectTag] =
|
|
71
|
+
typedArrayTags[regexpTag] =
|
|
72
|
+
typedArrayTags[setTag] =
|
|
73
|
+
typedArrayTags[stringTag] =
|
|
74
|
+
typedArrayTags[weakMapTag] =
|
|
75
|
+
false;
|
|
76
|
+
|
|
77
|
+
let freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
|
78
|
+
let freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
79
|
+
let root = freeGlobal || freeSelf || Function('return this')();
|
|
80
|
+
let freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
|
81
|
+
let freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
|
82
|
+
let moduleExports = freeModule && freeModule.exports === freeExports;
|
|
83
|
+
let freeProcess = moduleExports && freeGlobal.process;
|
|
84
|
+
|
|
85
|
+
let nodeUtil = (function () {
|
|
86
|
+
try {
|
|
87
|
+
return freeProcess && freeProcess.binding('util');
|
|
88
|
+
} catch (e) {}
|
|
89
|
+
})();
|
|
90
|
+
|
|
91
|
+
let nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
92
|
+
|
|
93
|
+
function arrayMap(array, iteratee) {
|
|
94
|
+
let index = -1,
|
|
95
|
+
length = array ? array.length : 0,
|
|
96
|
+
result = Array(length);
|
|
97
|
+
|
|
98
|
+
while (++index < length) {
|
|
99
|
+
result[index] = iteratee(array[index], index, array);
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function arraySome(array, predicate) {
|
|
105
|
+
let index = -1,
|
|
106
|
+
length = array ? array.length : 0;
|
|
107
|
+
|
|
108
|
+
while (++index < length) {
|
|
109
|
+
if (predicate(array[index], index, array)) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function baseProperty(key) {
|
|
117
|
+
return function (object) {
|
|
118
|
+
return object == null ? undefined : object[key];
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function baseSortBy(array, comparer) {
|
|
123
|
+
let length = array.length;
|
|
124
|
+
|
|
125
|
+
array.sort(comparer);
|
|
126
|
+
while (length--) {
|
|
127
|
+
array[length] = array[length].value;
|
|
128
|
+
}
|
|
129
|
+
return array;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function baseTimes(n, iteratee) {
|
|
133
|
+
let index = -1,
|
|
134
|
+
result = Array(n);
|
|
135
|
+
|
|
136
|
+
while (++index < n) {
|
|
137
|
+
result[index] = iteratee(index);
|
|
138
|
+
}
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function baseUnary(func) {
|
|
143
|
+
return function (value) {
|
|
144
|
+
return func(value);
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function getValue(object, key) {
|
|
149
|
+
return object == null ? undefined : object[key];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function isHostObject(value) {
|
|
153
|
+
let result = false;
|
|
154
|
+
if (value != null && typeof value.toString != 'function') {
|
|
155
|
+
try {
|
|
156
|
+
result = !!(value + '');
|
|
157
|
+
} catch (e) {}
|
|
158
|
+
}
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function mapToArray(map) {
|
|
163
|
+
let index = -1,
|
|
164
|
+
result = Array(map.size);
|
|
165
|
+
|
|
166
|
+
map.forEach(function (value, key) {
|
|
167
|
+
result[++index] = [key, value];
|
|
168
|
+
});
|
|
169
|
+
return result;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function overArg(func, transform) {
|
|
173
|
+
return function (arg) {
|
|
174
|
+
return func(transform(arg));
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function setToArray(set) {
|
|
179
|
+
let index = -1,
|
|
180
|
+
result = Array(set.size);
|
|
181
|
+
|
|
182
|
+
set.forEach(function (value) {
|
|
183
|
+
result[++index] = value;
|
|
184
|
+
});
|
|
185
|
+
return result;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
let arrayProto = Array.prototype,
|
|
189
|
+
funcProto = Function.prototype,
|
|
190
|
+
objectProto = Object.prototype;
|
|
191
|
+
|
|
192
|
+
let coreJsData = root['__core-js_shared__'];
|
|
193
|
+
let maskSrcKey = (function () {
|
|
194
|
+
let uid = /[^.]+$/.exec((coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO) || '');
|
|
195
|
+
return uid ? 'Symbol(src)_1.' + uid : '';
|
|
196
|
+
})();
|
|
197
|
+
|
|
198
|
+
let funcToString = funcProto.toString;
|
|
199
|
+
let hasOwnProperty = objectProto.hasOwnProperty;
|
|
200
|
+
let objectToString = objectProto.toString;
|
|
201
|
+
|
|
202
|
+
let reIsNative = RegExp(
|
|
203
|
+
'^' +
|
|
204
|
+
funcToString
|
|
205
|
+
.call(hasOwnProperty)
|
|
206
|
+
.replace(reRegExpChar, '\\$&')
|
|
207
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') +
|
|
208
|
+
'$'
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
let Symbol = root.Symbol,
|
|
212
|
+
Uint8Array = root.Uint8Array,
|
|
213
|
+
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
|
214
|
+
splice = arrayProto.splice;
|
|
215
|
+
|
|
216
|
+
let nativeKeys = overArg(Object.keys, Object);
|
|
217
|
+
|
|
218
|
+
let DataView = getNative(root, 'DataView'),
|
|
219
|
+
Map = getNative(root, 'Map'),
|
|
220
|
+
Promise = getNative(root, 'Promise'),
|
|
221
|
+
Set = getNative(root, 'Set'),
|
|
222
|
+
WeakMap = getNative(root, 'WeakMap'),
|
|
223
|
+
nativeCreate = getNative(Object, 'create');
|
|
224
|
+
|
|
225
|
+
let dataViewCtorString = toSource(DataView),
|
|
226
|
+
mapCtorString = toSource(Map),
|
|
227
|
+
promiseCtorString = toSource(Promise),
|
|
228
|
+
setCtorString = toSource(Set),
|
|
229
|
+
weakMapCtorString = toSource(WeakMap);
|
|
230
|
+
|
|
231
|
+
let symbolProto = Symbol ? Symbol.prototype : undefined,
|
|
232
|
+
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
|
|
233
|
+
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
234
|
+
|
|
235
|
+
function Hash(entries) {
|
|
236
|
+
let index = -1,
|
|
237
|
+
length = entries ? entries.length : 0;
|
|
238
|
+
|
|
239
|
+
this.clear();
|
|
240
|
+
while (++index < length) {
|
|
241
|
+
let entry = entries[index];
|
|
242
|
+
this.set(entry[0], entry[1]);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function hashClear() {
|
|
247
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function hashDelete(key) {
|
|
251
|
+
return this.has(key) && delete this.__data__[key];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function hashGet(key) {
|
|
255
|
+
let data = this.__data__;
|
|
256
|
+
if (nativeCreate) {
|
|
257
|
+
let result = data[key];
|
|
258
|
+
return result === HASH_UNDEFINED ? undefined : result;
|
|
259
|
+
}
|
|
260
|
+
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
function hashHas(key) {
|
|
264
|
+
let data = this.__data__;
|
|
265
|
+
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function hashSet(key, value) {
|
|
269
|
+
let data = this.__data__;
|
|
270
|
+
data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
|
|
271
|
+
return this;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
Hash.prototype.clear = hashClear;
|
|
275
|
+
Hash.prototype['delete'] = hashDelete;
|
|
276
|
+
Hash.prototype.get = hashGet;
|
|
277
|
+
Hash.prototype.has = hashHas;
|
|
278
|
+
Hash.prototype.set = hashSet;
|
|
279
|
+
|
|
280
|
+
function ListCache(entries) {
|
|
281
|
+
let index = -1,
|
|
282
|
+
length = entries ? entries.length : 0;
|
|
283
|
+
|
|
284
|
+
this.clear();
|
|
285
|
+
while (++index < length) {
|
|
286
|
+
let entry = entries[index];
|
|
287
|
+
this.set(entry[0], entry[1]);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function listCacheClear() {
|
|
292
|
+
this.__data__ = [];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function listCacheDelete(key) {
|
|
296
|
+
let data = this.__data__,
|
|
297
|
+
index = assocIndexOf(data, key);
|
|
298
|
+
|
|
299
|
+
if (index < 0) {
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
let lastIndex = data.length - 1;
|
|
303
|
+
if (index == lastIndex) {
|
|
304
|
+
data.pop();
|
|
305
|
+
} else {
|
|
306
|
+
splice.call(data, index, 1);
|
|
307
|
+
}
|
|
308
|
+
return true;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function listCacheGet(key) {
|
|
312
|
+
let data = this.__data__,
|
|
313
|
+
index = assocIndexOf(data, key);
|
|
314
|
+
|
|
315
|
+
return index < 0 ? undefined : data[index][1];
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function listCacheHas(key) {
|
|
319
|
+
return assocIndexOf(this.__data__, key) > -1;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function listCacheSet(key, value) {
|
|
323
|
+
let data = this.__data__,
|
|
324
|
+
index = assocIndexOf(data, key);
|
|
325
|
+
|
|
326
|
+
if (index < 0) {
|
|
327
|
+
data.push([key, value]);
|
|
328
|
+
} else {
|
|
329
|
+
data[index][1] = value;
|
|
330
|
+
}
|
|
331
|
+
return this;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
ListCache.prototype.clear = listCacheClear;
|
|
335
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
|
336
|
+
ListCache.prototype.get = listCacheGet;
|
|
337
|
+
ListCache.prototype.has = listCacheHas;
|
|
338
|
+
ListCache.prototype.set = listCacheSet;
|
|
339
|
+
|
|
340
|
+
function MapCache(entries) {
|
|
341
|
+
let index = -1,
|
|
342
|
+
length = entries ? entries.length : 0;
|
|
343
|
+
|
|
344
|
+
this.clear();
|
|
345
|
+
while (++index < length) {
|
|
346
|
+
let entry = entries[index];
|
|
347
|
+
this.set(entry[0], entry[1]);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function mapCacheClear() {
|
|
352
|
+
this.__data__ = {
|
|
353
|
+
hash: new Hash(),
|
|
354
|
+
map: new (Map || ListCache)(),
|
|
355
|
+
string: new Hash(),
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
function mapCacheDelete(key) {
|
|
360
|
+
return getMapData(this, key)['delete'](key);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function mapCacheGet(key) {
|
|
364
|
+
return getMapData(this, key).get(key);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function mapCacheHas(key) {
|
|
368
|
+
return getMapData(this, key).has(key);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
function mapCacheSet(key, value) {
|
|
372
|
+
getMapData(this, key).set(key, value);
|
|
373
|
+
return this;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
MapCache.prototype.clear = mapCacheClear;
|
|
377
|
+
MapCache.prototype['delete'] = mapCacheDelete;
|
|
378
|
+
MapCache.prototype.get = mapCacheGet;
|
|
379
|
+
MapCache.prototype.has = mapCacheHas;
|
|
380
|
+
MapCache.prototype.set = mapCacheSet;
|
|
381
|
+
|
|
382
|
+
function SetCache(values) {
|
|
383
|
+
let index = -1,
|
|
384
|
+
length = values ? values.length : 0;
|
|
385
|
+
|
|
386
|
+
this.__data__ = new MapCache();
|
|
387
|
+
while (++index < length) {
|
|
388
|
+
this.add(values[index]);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function setCacheAdd(value) {
|
|
393
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
|
394
|
+
return this;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function setCacheHas(value) {
|
|
398
|
+
return this.__data__.has(value);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
402
|
+
SetCache.prototype.has = setCacheHas;
|
|
403
|
+
|
|
404
|
+
function Stack(entries) {
|
|
405
|
+
this.__data__ = new ListCache(entries);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function stackClear() {
|
|
409
|
+
this.__data__ = new ListCache();
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
function stackDelete(key) {
|
|
413
|
+
return this.__data__['delete'](key);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function stackGet(key) {
|
|
417
|
+
return this.__data__.get(key);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function stackHas(key) {
|
|
421
|
+
return this.__data__.has(key);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
function stackSet(key, value) {
|
|
425
|
+
let cache = this.__data__;
|
|
426
|
+
if (cache instanceof ListCache) {
|
|
427
|
+
let pairs = cache.__data__;
|
|
428
|
+
if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
429
|
+
pairs.push([key, value]);
|
|
430
|
+
return this;
|
|
431
|
+
}
|
|
432
|
+
cache = this.__data__ = new MapCache(pairs);
|
|
433
|
+
}
|
|
434
|
+
cache.set(key, value);
|
|
435
|
+
return this;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
Stack.prototype.clear = stackClear;
|
|
439
|
+
Stack.prototype['delete'] = stackDelete;
|
|
440
|
+
Stack.prototype.get = stackGet;
|
|
441
|
+
Stack.prototype.has = stackHas;
|
|
442
|
+
Stack.prototype.set = stackSet;
|
|
443
|
+
|
|
444
|
+
function arrayLikeKeys(value, inherited) {
|
|
445
|
+
let result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
|
|
446
|
+
|
|
447
|
+
let length = result.length,
|
|
448
|
+
skipIndexes = !!length;
|
|
449
|
+
|
|
450
|
+
for (let key in value) {
|
|
451
|
+
if (
|
|
452
|
+
(inherited || hasOwnProperty.call(value, key)) &&
|
|
453
|
+
!(skipIndexes && (key == 'length' || isIndex(key, length)))
|
|
454
|
+
) {
|
|
455
|
+
result.push(key);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return result;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function assocIndexOf(array, key) {
|
|
462
|
+
let length = array.length;
|
|
463
|
+
while (length--) {
|
|
464
|
+
if (eq(array[length][0], key)) {
|
|
465
|
+
return length;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
return -1;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
let baseEach = createBaseEach(baseForOwn);
|
|
472
|
+
|
|
473
|
+
let baseFor = createBaseFor();
|
|
474
|
+
|
|
475
|
+
function baseForOwn(object, iteratee) {
|
|
476
|
+
return object && baseFor(object, iteratee, keys);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
function baseGet(object, path) {
|
|
480
|
+
path = isKey(path, object) ? [path] : castPath(path);
|
|
481
|
+
|
|
482
|
+
let index = 0,
|
|
483
|
+
length = path.length;
|
|
484
|
+
|
|
485
|
+
while (object != null && index < length) {
|
|
486
|
+
object = object[toKey(path[index++])];
|
|
487
|
+
}
|
|
488
|
+
return index && index == length ? object : undefined;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
function baseGetTag(value) {
|
|
492
|
+
return objectToString.call(value);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
function baseHasIn(object, key) {
|
|
496
|
+
return object != null && key in Object(object);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
function baseIsEqual(value, other, customizer, bitmask, stack) {
|
|
500
|
+
if (value === other) {
|
|
501
|
+
return true;
|
|
502
|
+
}
|
|
503
|
+
if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
|
|
504
|
+
return value !== value && other !== other;
|
|
505
|
+
}
|
|
506
|
+
return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {
|
|
510
|
+
let objIsArr = isArray(object),
|
|
511
|
+
othIsArr = isArray(other),
|
|
512
|
+
objTag = arrayTag,
|
|
513
|
+
othTag = arrayTag;
|
|
514
|
+
|
|
515
|
+
if (!objIsArr) {
|
|
516
|
+
objTag = getTag(object);
|
|
517
|
+
objTag = objTag == argsTag ? objectTag : objTag;
|
|
518
|
+
}
|
|
519
|
+
if (!othIsArr) {
|
|
520
|
+
othTag = getTag(other);
|
|
521
|
+
othTag = othTag == argsTag ? objectTag : othTag;
|
|
522
|
+
}
|
|
523
|
+
let objIsObj = objTag == objectTag && !isHostObject(object),
|
|
524
|
+
othIsObj = othTag == objectTag && !isHostObject(other),
|
|
525
|
+
isSameTag = objTag == othTag;
|
|
526
|
+
|
|
527
|
+
if (isSameTag && !objIsObj) {
|
|
528
|
+
stack || (stack = new Stack());
|
|
529
|
+
return objIsArr || isTypedArray(object)
|
|
530
|
+
? equalArrays(object, other, equalFunc, customizer, bitmask, stack)
|
|
531
|
+
: equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);
|
|
532
|
+
}
|
|
533
|
+
if (!(bitmask & PARTIAL_COMPARE_FLAG)) {
|
|
534
|
+
let objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
|
535
|
+
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
|
536
|
+
|
|
537
|
+
if (objIsWrapped || othIsWrapped) {
|
|
538
|
+
let objUnwrapped = objIsWrapped ? object.value() : object,
|
|
539
|
+
othUnwrapped = othIsWrapped ? other.value() : other;
|
|
540
|
+
|
|
541
|
+
stack || (stack = new Stack());
|
|
542
|
+
return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
if (!isSameTag) {
|
|
546
|
+
return false;
|
|
547
|
+
}
|
|
548
|
+
stack || (stack = new Stack());
|
|
549
|
+
return equalObjects(object, other, equalFunc, customizer, bitmask, stack);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
function baseIsMatch(object, source, matchData, customizer) {
|
|
553
|
+
let index = matchData.length,
|
|
554
|
+
length = index,
|
|
555
|
+
noCustomizer = !customizer;
|
|
556
|
+
|
|
557
|
+
if (object == null) {
|
|
558
|
+
return !length;
|
|
559
|
+
}
|
|
560
|
+
object = Object(object);
|
|
561
|
+
while (index--) {
|
|
562
|
+
let data = matchData[index];
|
|
563
|
+
if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
|
|
564
|
+
return false;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
while (++index < length) {
|
|
568
|
+
data = matchData[index];
|
|
569
|
+
let key = data[0],
|
|
570
|
+
objValue = object[key],
|
|
571
|
+
srcValue = data[1];
|
|
572
|
+
|
|
573
|
+
if (noCustomizer && data[2]) {
|
|
574
|
+
if (objValue === undefined && !(key in object)) {
|
|
575
|
+
return false;
|
|
576
|
+
}
|
|
577
|
+
} else {
|
|
578
|
+
let stack = new Stack();
|
|
579
|
+
if (customizer) {
|
|
580
|
+
let result = customizer(objValue, srcValue, key, object, source, stack);
|
|
581
|
+
}
|
|
582
|
+
if (
|
|
583
|
+
!(result === undefined
|
|
584
|
+
? baseIsEqual(
|
|
585
|
+
srcValue,
|
|
586
|
+
objValue,
|
|
587
|
+
customizer,
|
|
588
|
+
UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG,
|
|
589
|
+
stack
|
|
590
|
+
)
|
|
591
|
+
: result)
|
|
592
|
+
) {
|
|
593
|
+
return false;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
return true;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function baseIsNative(value) {
|
|
601
|
+
if (!isObject(value) || isMasked(value)) {
|
|
602
|
+
return false;
|
|
603
|
+
}
|
|
604
|
+
let pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
|
|
605
|
+
return pattern.test(toSource(value));
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
function baseIsTypedArray(value) {
|
|
609
|
+
return (
|
|
610
|
+
isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]
|
|
611
|
+
);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
function baseIteratee(value) {
|
|
615
|
+
if (typeof value == 'function') {
|
|
616
|
+
return value;
|
|
617
|
+
}
|
|
618
|
+
if (value == null) {
|
|
619
|
+
return identity;
|
|
620
|
+
}
|
|
621
|
+
if (typeof value == 'object') {
|
|
622
|
+
return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
|
|
623
|
+
}
|
|
624
|
+
return property(value);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
function baseKeys(object) {
|
|
628
|
+
if (!isPrototype(object)) {
|
|
629
|
+
return nativeKeys(object);
|
|
630
|
+
}
|
|
631
|
+
let result = [];
|
|
632
|
+
for (let key in Object(object)) {
|
|
633
|
+
if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
|
634
|
+
result.push(key);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
return result;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function baseMap(collection, iteratee) {
|
|
641
|
+
let index = -1,
|
|
642
|
+
result = isArrayLike(collection) ? Array(collection.length) : [];
|
|
643
|
+
|
|
644
|
+
baseEach(collection, function (value, key, collection) {
|
|
645
|
+
result[++index] = iteratee(value, key, collection);
|
|
646
|
+
});
|
|
647
|
+
return result;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
function baseMatches(source) {
|
|
651
|
+
let matchData = getMatchData(source);
|
|
652
|
+
if (matchData.length == 1 && matchData[0][2]) {
|
|
653
|
+
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
|
654
|
+
}
|
|
655
|
+
return function (object) {
|
|
656
|
+
return object === source || baseIsMatch(object, source, matchData);
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
function baseMatchesProperty(path, srcValue) {
|
|
661
|
+
if (isKey(path) && isStrictComparable(srcValue)) {
|
|
662
|
+
return matchesStrictComparable(toKey(path), srcValue);
|
|
663
|
+
}
|
|
664
|
+
return function (object) {
|
|
665
|
+
let objValue = get(object, path);
|
|
666
|
+
return objValue === undefined && objValue === srcValue
|
|
667
|
+
? hasIn(object, path)
|
|
668
|
+
: baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
function baseOrderBy(collection, iteratees, orders) {
|
|
673
|
+
let index = -1;
|
|
674
|
+
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
|
|
675
|
+
|
|
676
|
+
let result = baseMap(collection, function (value, key, collection) {
|
|
677
|
+
let criteria = arrayMap(iteratees, function (iteratee) {
|
|
678
|
+
return iteratee(value);
|
|
679
|
+
});
|
|
680
|
+
return { criteria: criteria, index: ++index, value: value };
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
return baseSortBy(result, function (object, other) {
|
|
684
|
+
return compareMultiple(object, other, orders);
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
function basePropertyDeep(path) {
|
|
689
|
+
return function (object) {
|
|
690
|
+
return baseGet(object, path);
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
function baseToString(value) {
|
|
695
|
+
if (typeof value == 'string') {
|
|
696
|
+
return value;
|
|
697
|
+
}
|
|
698
|
+
if (isSymbol(value)) {
|
|
699
|
+
return symbolToString ? symbolToString.call(value) : '';
|
|
700
|
+
}
|
|
701
|
+
let result = value + '';
|
|
702
|
+
return result == '0' && 1 / value == -INFINITY ? '-0' : result;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
function castPath(value) {
|
|
706
|
+
return isArray(value) ? value : stringToPath(value);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
function compareAscending(value, other) {
|
|
710
|
+
if (value !== other) {
|
|
711
|
+
let valIsDefined = value !== undefined,
|
|
712
|
+
valIsNull = value === null,
|
|
713
|
+
valIsReflexive = value === value,
|
|
714
|
+
valIsSymbol = isSymbol(value);
|
|
715
|
+
|
|
716
|
+
let othIsDefined = other !== undefined,
|
|
717
|
+
othIsNull = other === null,
|
|
718
|
+
othIsReflexive = other === other,
|
|
719
|
+
othIsSymbol = isSymbol(other);
|
|
720
|
+
|
|
721
|
+
if (
|
|
722
|
+
(!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
|
|
723
|
+
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
|
|
724
|
+
(valIsNull && othIsDefined && othIsReflexive) ||
|
|
725
|
+
(!valIsDefined && othIsReflexive) ||
|
|
726
|
+
!valIsReflexive
|
|
727
|
+
) {
|
|
728
|
+
return 1;
|
|
729
|
+
}
|
|
730
|
+
if (
|
|
731
|
+
(!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
|
|
732
|
+
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
|
|
733
|
+
(othIsNull && valIsDefined && valIsReflexive) ||
|
|
734
|
+
(!othIsDefined && valIsReflexive) ||
|
|
735
|
+
!othIsReflexive
|
|
736
|
+
) {
|
|
737
|
+
return -1;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
return 0;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
function compareMultiple(object, other, orders) {
|
|
744
|
+
let index = -1,
|
|
745
|
+
objCriteria = object.criteria,
|
|
746
|
+
othCriteria = other.criteria,
|
|
747
|
+
length = objCriteria.length,
|
|
748
|
+
ordersLength = orders.length;
|
|
749
|
+
|
|
750
|
+
while (++index < length) {
|
|
751
|
+
let result = compareAscending(objCriteria[index], othCriteria[index]);
|
|
752
|
+
if (result) {
|
|
753
|
+
if (index >= ordersLength) {
|
|
754
|
+
return result;
|
|
755
|
+
}
|
|
756
|
+
let order = orders[index];
|
|
757
|
+
return result * (order == 'desc' ? -1 : 1);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
return object.index - other.index;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
function createBaseEach(eachFunc, fromRight) {
|
|
765
|
+
return function (collection, iteratee) {
|
|
766
|
+
if (collection == null) {
|
|
767
|
+
return collection;
|
|
768
|
+
}
|
|
769
|
+
if (!isArrayLike(collection)) {
|
|
770
|
+
return eachFunc(collection, iteratee);
|
|
771
|
+
}
|
|
772
|
+
let length = collection.length;
|
|
773
|
+
|
|
774
|
+
let index = fromRight ? length : -1;
|
|
775
|
+
let iterable = Object(collection);
|
|
776
|
+
|
|
777
|
+
while (fromRight ? index-- : ++index < length) {
|
|
778
|
+
if (iteratee(iterable[index], index, iterable) === false) {
|
|
779
|
+
break;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
return collection;
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
function createBaseFor(fromRight) {
|
|
787
|
+
return function (object, iteratee, keysFunc) {
|
|
788
|
+
let index = -1,
|
|
789
|
+
iterable = Object(object),
|
|
790
|
+
props = keysFunc(object),
|
|
791
|
+
length = props.length;
|
|
792
|
+
|
|
793
|
+
while (length--) {
|
|
794
|
+
let key = props[fromRight ? length : ++index];
|
|
795
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
796
|
+
break;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
return object;
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
function equalArrays(array, other, equalFunc, customizer, bitmask, stack) {
|
|
804
|
+
let isPartial = bitmask & PARTIAL_COMPARE_FLAG,
|
|
805
|
+
arrLength = array.length,
|
|
806
|
+
othLength = other.length;
|
|
807
|
+
|
|
808
|
+
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
809
|
+
return false;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
let stacked = stack.get(array);
|
|
813
|
+
if (stacked && stack.get(other)) {
|
|
814
|
+
return stacked == other;
|
|
815
|
+
}
|
|
816
|
+
let index = -1,
|
|
817
|
+
result = true,
|
|
818
|
+
seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : undefined;
|
|
819
|
+
|
|
820
|
+
stack.set(array, other);
|
|
821
|
+
stack.set(other, array);
|
|
822
|
+
|
|
823
|
+
while (++index < arrLength) {
|
|
824
|
+
let arrValue = array[index],
|
|
825
|
+
othValue = other[index];
|
|
826
|
+
|
|
827
|
+
if (customizer) {
|
|
828
|
+
let compared = isPartial
|
|
829
|
+
? customizer(othValue, arrValue, index, other, array, stack)
|
|
830
|
+
: customizer(arrValue, othValue, index, array, other, stack);
|
|
831
|
+
}
|
|
832
|
+
if (compared !== undefined) {
|
|
833
|
+
if (compared) {
|
|
834
|
+
continue;
|
|
835
|
+
}
|
|
836
|
+
result = false;
|
|
837
|
+
break;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
if (seen) {
|
|
841
|
+
if (
|
|
842
|
+
!arraySome(other, function (othValue, othIndex) {
|
|
843
|
+
if (
|
|
844
|
+
!seen.has(othIndex) &&
|
|
845
|
+
(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))
|
|
846
|
+
) {
|
|
847
|
+
return seen.add(othIndex);
|
|
848
|
+
}
|
|
849
|
+
})
|
|
850
|
+
) {
|
|
851
|
+
result = false;
|
|
852
|
+
break;
|
|
853
|
+
}
|
|
854
|
+
} else if (
|
|
855
|
+
!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))
|
|
856
|
+
) {
|
|
857
|
+
result = false;
|
|
858
|
+
break;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
stack['delete'](array);
|
|
862
|
+
stack['delete'](other);
|
|
863
|
+
return result;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {
|
|
867
|
+
switch (tag) {
|
|
868
|
+
case dataViewTag:
|
|
869
|
+
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
|
870
|
+
return false;
|
|
871
|
+
}
|
|
872
|
+
object = object.buffer;
|
|
873
|
+
other = other.buffer;
|
|
874
|
+
|
|
875
|
+
case arrayBufferTag:
|
|
876
|
+
if (
|
|
877
|
+
object.byteLength != other.byteLength ||
|
|
878
|
+
!equalFunc(new Uint8Array(object), new Uint8Array(other))
|
|
879
|
+
) {
|
|
880
|
+
return false;
|
|
881
|
+
}
|
|
882
|
+
return true;
|
|
883
|
+
|
|
884
|
+
case boolTag:
|
|
885
|
+
case dateTag:
|
|
886
|
+
case numberTag:
|
|
887
|
+
return eq(+object, +other);
|
|
888
|
+
|
|
889
|
+
case errorTag:
|
|
890
|
+
return object.name == other.name && object.message == other.message;
|
|
891
|
+
|
|
892
|
+
case regexpTag:
|
|
893
|
+
case stringTag:
|
|
894
|
+
return object == other + '';
|
|
895
|
+
|
|
896
|
+
case mapTag:
|
|
897
|
+
let convert = mapToArray;
|
|
898
|
+
|
|
899
|
+
case setTag:
|
|
900
|
+
let isPartial = bitmask & PARTIAL_COMPARE_FLAG;
|
|
901
|
+
convert || (convert = setToArray);
|
|
902
|
+
|
|
903
|
+
if (object.size != other.size && !isPartial) {
|
|
904
|
+
return false;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
let stacked = stack.get(object);
|
|
908
|
+
if (stacked) {
|
|
909
|
+
return stacked == other;
|
|
910
|
+
}
|
|
911
|
+
bitmask |= UNORDERED_COMPARE_FLAG;
|
|
912
|
+
|
|
913
|
+
stack.set(object, other);
|
|
914
|
+
let result = equalArrays(
|
|
915
|
+
convert(object),
|
|
916
|
+
convert(other),
|
|
917
|
+
equalFunc,
|
|
918
|
+
customizer,
|
|
919
|
+
bitmask,
|
|
920
|
+
stack
|
|
921
|
+
);
|
|
922
|
+
stack['delete'](object);
|
|
923
|
+
return result;
|
|
924
|
+
|
|
925
|
+
case symbolTag:
|
|
926
|
+
if (symbolValueOf) {
|
|
927
|
+
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
return false;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
function equalObjects(object, other, equalFunc, customizer, bitmask, stack) {
|
|
934
|
+
let isPartial = bitmask & PARTIAL_COMPARE_FLAG,
|
|
935
|
+
objProps = keys(object),
|
|
936
|
+
objLength = objProps.length,
|
|
937
|
+
othProps = keys(other),
|
|
938
|
+
othLength = othProps.length;
|
|
939
|
+
|
|
940
|
+
if (objLength != othLength && !isPartial) {
|
|
941
|
+
return false;
|
|
942
|
+
}
|
|
943
|
+
let index = objLength;
|
|
944
|
+
while (index--) {
|
|
945
|
+
let key = objProps[index];
|
|
946
|
+
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
|
947
|
+
return false;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
let stacked = stack.get(object);
|
|
952
|
+
if (stacked && stack.get(other)) {
|
|
953
|
+
return stacked == other;
|
|
954
|
+
}
|
|
955
|
+
let result = true;
|
|
956
|
+
stack.set(object, other);
|
|
957
|
+
stack.set(other, object);
|
|
958
|
+
|
|
959
|
+
let skipCtor = isPartial;
|
|
960
|
+
while (++index < objLength) {
|
|
961
|
+
key = objProps[index];
|
|
962
|
+
let objValue = object[key],
|
|
963
|
+
othValue = other[key];
|
|
964
|
+
|
|
965
|
+
if (customizer) {
|
|
966
|
+
let compared = isPartial
|
|
967
|
+
? customizer(othValue, objValue, key, other, object, stack)
|
|
968
|
+
: customizer(objValue, othValue, key, object, other, stack);
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
if (
|
|
972
|
+
!(compared === undefined
|
|
973
|
+
? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)
|
|
974
|
+
: compared)
|
|
975
|
+
) {
|
|
976
|
+
result = false;
|
|
977
|
+
break;
|
|
978
|
+
}
|
|
979
|
+
skipCtor || (skipCtor = key == 'constructor');
|
|
980
|
+
}
|
|
981
|
+
if (result && !skipCtor) {
|
|
982
|
+
let objCtor = object.constructor,
|
|
983
|
+
othCtor = other.constructor;
|
|
984
|
+
|
|
985
|
+
if (
|
|
986
|
+
objCtor != othCtor &&
|
|
987
|
+
'constructor' in object &&
|
|
988
|
+
'constructor' in other &&
|
|
989
|
+
!(
|
|
990
|
+
typeof objCtor == 'function' &&
|
|
991
|
+
objCtor instanceof objCtor &&
|
|
992
|
+
typeof othCtor == 'function' &&
|
|
993
|
+
othCtor instanceof othCtor
|
|
994
|
+
)
|
|
995
|
+
) {
|
|
996
|
+
result = false;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
stack['delete'](object);
|
|
1000
|
+
stack['delete'](other);
|
|
1001
|
+
return result;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
function getMapData(map, key) {
|
|
1005
|
+
let data = map.__data__;
|
|
1006
|
+
return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
function getMatchData(object) {
|
|
1010
|
+
let result = keys(object),
|
|
1011
|
+
length = result.length;
|
|
1012
|
+
|
|
1013
|
+
while (length--) {
|
|
1014
|
+
let key = result[length],
|
|
1015
|
+
value = object[key];
|
|
1016
|
+
|
|
1017
|
+
result[length] = [key, value, isStrictComparable(value)];
|
|
1018
|
+
}
|
|
1019
|
+
return result;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
function getNative(object, key) {
|
|
1023
|
+
let value = getValue(object, key);
|
|
1024
|
+
return baseIsNative(value) ? value : undefined;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
let getTag = baseGetTag;
|
|
1028
|
+
|
|
1029
|
+
if (
|
|
1030
|
+
(DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|
1031
|
+
(Map && getTag(new Map()) != mapTag) ||
|
|
1032
|
+
(Promise && getTag(Promise.resolve()) != promiseTag) ||
|
|
1033
|
+
(Set && getTag(new Set()) != setTag) ||
|
|
1034
|
+
(WeakMap && getTag(new WeakMap()) != weakMapTag)
|
|
1035
|
+
) {
|
|
1036
|
+
getTag = function (value) {
|
|
1037
|
+
let result = objectToString.call(value),
|
|
1038
|
+
Ctor = result == objectTag ? value.constructor : undefined,
|
|
1039
|
+
ctorString = Ctor ? toSource(Ctor) : undefined;
|
|
1040
|
+
|
|
1041
|
+
if (ctorString) {
|
|
1042
|
+
switch (ctorString) {
|
|
1043
|
+
case dataViewCtorString:
|
|
1044
|
+
return dataViewTag;
|
|
1045
|
+
case mapCtorString:
|
|
1046
|
+
return mapTag;
|
|
1047
|
+
case promiseCtorString:
|
|
1048
|
+
return promiseTag;
|
|
1049
|
+
case setCtorString:
|
|
1050
|
+
return setTag;
|
|
1051
|
+
case weakMapCtorString:
|
|
1052
|
+
return weakMapTag;
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
return result;
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
function hasPath(object, path, hasFunc) {
|
|
1060
|
+
path = isKey(path, object) ? [path] : castPath(path);
|
|
1061
|
+
|
|
1062
|
+
let result;
|
|
1063
|
+
let index = -1;
|
|
1064
|
+
let length = path.length;
|
|
1065
|
+
|
|
1066
|
+
while (++index < length) {
|
|
1067
|
+
let key = toKey(path[index]);
|
|
1068
|
+
if (!(result = object != null && hasFunc(object, key))) {
|
|
1069
|
+
break;
|
|
1070
|
+
}
|
|
1071
|
+
object = object[key];
|
|
1072
|
+
}
|
|
1073
|
+
if (result) {
|
|
1074
|
+
return result;
|
|
1075
|
+
}
|
|
1076
|
+
length = object ? object.length : 0;
|
|
1077
|
+
return (
|
|
1078
|
+
!!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object))
|
|
1079
|
+
);
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
function isIndex(value, length) {
|
|
1083
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
1084
|
+
return (
|
|
1085
|
+
!!length &&
|
|
1086
|
+
(typeof value == 'number' || reIsUint.test(value)) &&
|
|
1087
|
+
value > -1 &&
|
|
1088
|
+
value % 1 == 0 &&
|
|
1089
|
+
value < length
|
|
1090
|
+
);
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
function isKey(value, object) {
|
|
1094
|
+
if (isArray(value)) {
|
|
1095
|
+
return false;
|
|
1096
|
+
}
|
|
1097
|
+
let type = typeof value;
|
|
1098
|
+
if (
|
|
1099
|
+
type == 'number' ||
|
|
1100
|
+
type == 'symbol' ||
|
|
1101
|
+
type == 'boolean' ||
|
|
1102
|
+
value == null ||
|
|
1103
|
+
isSymbol(value)
|
|
1104
|
+
) {
|
|
1105
|
+
return true;
|
|
1106
|
+
}
|
|
1107
|
+
return (
|
|
1108
|
+
reIsPlainProp.test(value) ||
|
|
1109
|
+
!reIsDeepProp.test(value) ||
|
|
1110
|
+
(object != null && value in Object(object))
|
|
1111
|
+
);
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
function isKeyable(value) {
|
|
1115
|
+
let type = typeof value;
|
|
1116
|
+
return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean'
|
|
1117
|
+
? value !== '__proto__'
|
|
1118
|
+
: value === null;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
function isMasked(func) {
|
|
1122
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
function isPrototype(value) {
|
|
1126
|
+
let Ctor = value && value.constructor,
|
|
1127
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
|
1128
|
+
|
|
1129
|
+
return value === proto;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
function isStrictComparable(value) {
|
|
1133
|
+
return value === value && !isObject(value);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
function matchesStrictComparable(key, srcValue) {
|
|
1137
|
+
return function (object) {
|
|
1138
|
+
if (object == null) {
|
|
1139
|
+
return false;
|
|
1140
|
+
}
|
|
1141
|
+
return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
let stringToPath = memoize(function (string) {
|
|
1146
|
+
string = toString(string);
|
|
1147
|
+
|
|
1148
|
+
let result = [];
|
|
1149
|
+
if (reLeadingDot.test(string)) {
|
|
1150
|
+
result.push('');
|
|
1151
|
+
}
|
|
1152
|
+
string.replace(rePropName, function (match, number, quote, string) {
|
|
1153
|
+
result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
|
|
1154
|
+
});
|
|
1155
|
+
return result;
|
|
1156
|
+
});
|
|
1157
|
+
|
|
1158
|
+
function toKey(value) {
|
|
1159
|
+
if (typeof value == 'string' || isSymbol(value)) {
|
|
1160
|
+
return value;
|
|
1161
|
+
}
|
|
1162
|
+
let result = value + '';
|
|
1163
|
+
return result == '0' && 1 / value == -INFINITY ? '-0' : result;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
function toSource(func) {
|
|
1167
|
+
if (func != null) {
|
|
1168
|
+
try {
|
|
1169
|
+
return funcToString.call(func);
|
|
1170
|
+
} catch (e) {}
|
|
1171
|
+
try {
|
|
1172
|
+
return func + '';
|
|
1173
|
+
} catch (e) {}
|
|
1174
|
+
}
|
|
1175
|
+
return '';
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
function zxhiddenCustomOrderByByJeremyAshkenas(collection, iteratees, orders) {
|
|
1179
|
+
if (collection == null) {
|
|
1180
|
+
return [];
|
|
1181
|
+
}
|
|
1182
|
+
if (!isArray(iteratees)) {
|
|
1183
|
+
iteratees = iteratees == null ? [] : [iteratees];
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
if (!isArray(orders)) {
|
|
1187
|
+
orders = orders == null ? [] : [orders];
|
|
1188
|
+
}
|
|
1189
|
+
return baseOrderBy(collection, iteratees, orders);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
function memoize(func, resolver) {
|
|
1193
|
+
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
|
|
1194
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
1195
|
+
}
|
|
1196
|
+
let memoized = function () {
|
|
1197
|
+
let args = arguments,
|
|
1198
|
+
key = resolver ? resolver.apply(this, args) : args[0],
|
|
1199
|
+
cache = memoized.cache;
|
|
1200
|
+
|
|
1201
|
+
if (cache.has(key)) {
|
|
1202
|
+
return cache.get(key);
|
|
1203
|
+
}
|
|
1204
|
+
let result = func.apply(this, args);
|
|
1205
|
+
memoized.cache = cache.set(key, result);
|
|
1206
|
+
return result;
|
|
1207
|
+
};
|
|
1208
|
+
memoized.cache = new (memoize.Cache || MapCache)();
|
|
1209
|
+
return memoized;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
memoize.Cache = MapCache;
|
|
1213
|
+
|
|
1214
|
+
function eq(value, other) {
|
|
1215
|
+
return value === other || (value !== value && other !== other);
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
function isArguments(value) {
|
|
1219
|
+
return (
|
|
1220
|
+
isArrayLikeObject(value) &&
|
|
1221
|
+
hasOwnProperty.call(value, 'callee') &&
|
|
1222
|
+
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag)
|
|
1223
|
+
);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
let isArray = Array.isArray;
|
|
1227
|
+
|
|
1228
|
+
function isArrayLike(value) {
|
|
1229
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
function isArrayLikeObject(value) {
|
|
1233
|
+
return isObjectLike(value) && isArrayLike(value);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
function isFunction(value) {
|
|
1237
|
+
let tag = isObject(value) ? objectToString.call(value) : '';
|
|
1238
|
+
return tag == funcTag || tag == genTag;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
function isLength(value) {
|
|
1242
|
+
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
function isObject(value) {
|
|
1246
|
+
let type = typeof value;
|
|
1247
|
+
return !!value && (type == 'object' || type == 'function');
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
function isObjectLike(value) {
|
|
1251
|
+
return !!value && typeof value == 'object';
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
function isSymbol(value) {
|
|
1255
|
+
return (
|
|
1256
|
+
typeof value == 'symbol' || (isObjectLike(value) && objectToString.call(value) == symbolTag)
|
|
1257
|
+
);
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
let isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
1261
|
+
|
|
1262
|
+
function toString(value) {
|
|
1263
|
+
return value == null ? '' : baseToString(value);
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
function get(object, path, defaultValue) {
|
|
1267
|
+
let result = object == null ? undefined : baseGet(object, path);
|
|
1268
|
+
return result === undefined ? defaultValue : result;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
function hasIn(object, path) {
|
|
1272
|
+
return object != null && hasPath(object, path, baseHasIn);
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
function keys(object) {
|
|
1276
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
function identity(value) {
|
|
1280
|
+
return value;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
function property(path) {
|
|
1284
|
+
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
export default zxhiddenCustomOrderByByJeremyAshkenas;
|