ztxkutils 2.10.53 → 2.10.55
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +1 -1
- package/dist/request-1ac889d2.js +2910 -0
- package/dist/request-3c906c2d.js +2913 -0
- package/dist/request.d.ts +2 -0
- package/dist/request.js +1 -1
- package/package.json +1 -1
@@ -0,0 +1,2913 @@
|
|
1
|
+
import { a as __rest, _ as __assign } from './tslib.es6-35653116.js';
|
2
|
+
import axios from 'axios';
|
3
|
+
import { Modal, message } from 'ztxkui';
|
4
|
+
import { c as commonjsGlobal, a as crypto } from './crypto-c481f616.js';
|
5
|
+
import { g as getToken, r as removeToken, a as removeRefreshToken, b as getRefreshToken, s as setToken, c as setRefreshToken } from './authority-7a91cb9f.js';
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Removes all key-value entries from the list cache.
|
9
|
+
*
|
10
|
+
* @private
|
11
|
+
* @name clear
|
12
|
+
* @memberOf ListCache
|
13
|
+
*/
|
14
|
+
|
15
|
+
function listCacheClear$1() {
|
16
|
+
this.__data__ = [];
|
17
|
+
this.size = 0;
|
18
|
+
}
|
19
|
+
|
20
|
+
var _listCacheClear = listCacheClear$1;
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Performs a
|
24
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
25
|
+
* comparison between two values to determine if they are equivalent.
|
26
|
+
*
|
27
|
+
* @static
|
28
|
+
* @memberOf _
|
29
|
+
* @since 4.0.0
|
30
|
+
* @category Lang
|
31
|
+
* @param {*} value The value to compare.
|
32
|
+
* @param {*} other The other value to compare.
|
33
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
34
|
+
* @example
|
35
|
+
*
|
36
|
+
* var object = { 'a': 1 };
|
37
|
+
* var other = { 'a': 1 };
|
38
|
+
*
|
39
|
+
* _.eq(object, object);
|
40
|
+
* // => true
|
41
|
+
*
|
42
|
+
* _.eq(object, other);
|
43
|
+
* // => false
|
44
|
+
*
|
45
|
+
* _.eq('a', 'a');
|
46
|
+
* // => true
|
47
|
+
*
|
48
|
+
* _.eq('a', Object('a'));
|
49
|
+
* // => false
|
50
|
+
*
|
51
|
+
* _.eq(NaN, NaN);
|
52
|
+
* // => true
|
53
|
+
*/
|
54
|
+
|
55
|
+
function eq$2(value, other) {
|
56
|
+
return value === other || (value !== value && other !== other);
|
57
|
+
}
|
58
|
+
|
59
|
+
var eq_1 = eq$2;
|
60
|
+
|
61
|
+
var eq$1 = eq_1;
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
65
|
+
*
|
66
|
+
* @private
|
67
|
+
* @param {Array} array The array to inspect.
|
68
|
+
* @param {*} key The key to search for.
|
69
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
70
|
+
*/
|
71
|
+
function assocIndexOf$4(array, key) {
|
72
|
+
var length = array.length;
|
73
|
+
while (length--) {
|
74
|
+
if (eq$1(array[length][0], key)) {
|
75
|
+
return length;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
return -1;
|
79
|
+
}
|
80
|
+
|
81
|
+
var _assocIndexOf = assocIndexOf$4;
|
82
|
+
|
83
|
+
var assocIndexOf$3 = _assocIndexOf;
|
84
|
+
|
85
|
+
/** Used for built-in method references. */
|
86
|
+
var arrayProto = Array.prototype;
|
87
|
+
|
88
|
+
/** Built-in value references. */
|
89
|
+
var splice = arrayProto.splice;
|
90
|
+
|
91
|
+
/**
|
92
|
+
* Removes `key` and its value from the list cache.
|
93
|
+
*
|
94
|
+
* @private
|
95
|
+
* @name delete
|
96
|
+
* @memberOf ListCache
|
97
|
+
* @param {string} key The key of the value to remove.
|
98
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
99
|
+
*/
|
100
|
+
function listCacheDelete$1(key) {
|
101
|
+
var data = this.__data__,
|
102
|
+
index = assocIndexOf$3(data, key);
|
103
|
+
|
104
|
+
if (index < 0) {
|
105
|
+
return false;
|
106
|
+
}
|
107
|
+
var lastIndex = data.length - 1;
|
108
|
+
if (index == lastIndex) {
|
109
|
+
data.pop();
|
110
|
+
} else {
|
111
|
+
splice.call(data, index, 1);
|
112
|
+
}
|
113
|
+
--this.size;
|
114
|
+
return true;
|
115
|
+
}
|
116
|
+
|
117
|
+
var _listCacheDelete = listCacheDelete$1;
|
118
|
+
|
119
|
+
var assocIndexOf$2 = _assocIndexOf;
|
120
|
+
|
121
|
+
/**
|
122
|
+
* Gets the list cache value for `key`.
|
123
|
+
*
|
124
|
+
* @private
|
125
|
+
* @name get
|
126
|
+
* @memberOf ListCache
|
127
|
+
* @param {string} key The key of the value to get.
|
128
|
+
* @returns {*} Returns the entry value.
|
129
|
+
*/
|
130
|
+
function listCacheGet$1(key) {
|
131
|
+
var data = this.__data__,
|
132
|
+
index = assocIndexOf$2(data, key);
|
133
|
+
|
134
|
+
return index < 0 ? undefined : data[index][1];
|
135
|
+
}
|
136
|
+
|
137
|
+
var _listCacheGet = listCacheGet$1;
|
138
|
+
|
139
|
+
var assocIndexOf$1 = _assocIndexOf;
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Checks if a list cache value for `key` exists.
|
143
|
+
*
|
144
|
+
* @private
|
145
|
+
* @name has
|
146
|
+
* @memberOf ListCache
|
147
|
+
* @param {string} key The key of the entry to check.
|
148
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
149
|
+
*/
|
150
|
+
function listCacheHas$1(key) {
|
151
|
+
return assocIndexOf$1(this.__data__, key) > -1;
|
152
|
+
}
|
153
|
+
|
154
|
+
var _listCacheHas = listCacheHas$1;
|
155
|
+
|
156
|
+
var assocIndexOf = _assocIndexOf;
|
157
|
+
|
158
|
+
/**
|
159
|
+
* Sets the list cache `key` to `value`.
|
160
|
+
*
|
161
|
+
* @private
|
162
|
+
* @name set
|
163
|
+
* @memberOf ListCache
|
164
|
+
* @param {string} key The key of the value to set.
|
165
|
+
* @param {*} value The value to set.
|
166
|
+
* @returns {Object} Returns the list cache instance.
|
167
|
+
*/
|
168
|
+
function listCacheSet$1(key, value) {
|
169
|
+
var data = this.__data__,
|
170
|
+
index = assocIndexOf(data, key);
|
171
|
+
|
172
|
+
if (index < 0) {
|
173
|
+
++this.size;
|
174
|
+
data.push([key, value]);
|
175
|
+
} else {
|
176
|
+
data[index][1] = value;
|
177
|
+
}
|
178
|
+
return this;
|
179
|
+
}
|
180
|
+
|
181
|
+
var _listCacheSet = listCacheSet$1;
|
182
|
+
|
183
|
+
var listCacheClear = _listCacheClear,
|
184
|
+
listCacheDelete = _listCacheDelete,
|
185
|
+
listCacheGet = _listCacheGet,
|
186
|
+
listCacheHas = _listCacheHas,
|
187
|
+
listCacheSet = _listCacheSet;
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Creates an list cache object.
|
191
|
+
*
|
192
|
+
* @private
|
193
|
+
* @constructor
|
194
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
195
|
+
*/
|
196
|
+
function ListCache$4(entries) {
|
197
|
+
var index = -1,
|
198
|
+
length = entries == null ? 0 : entries.length;
|
199
|
+
|
200
|
+
this.clear();
|
201
|
+
while (++index < length) {
|
202
|
+
var entry = entries[index];
|
203
|
+
this.set(entry[0], entry[1]);
|
204
|
+
}
|
205
|
+
}
|
206
|
+
|
207
|
+
// Add methods to `ListCache`.
|
208
|
+
ListCache$4.prototype.clear = listCacheClear;
|
209
|
+
ListCache$4.prototype['delete'] = listCacheDelete;
|
210
|
+
ListCache$4.prototype.get = listCacheGet;
|
211
|
+
ListCache$4.prototype.has = listCacheHas;
|
212
|
+
ListCache$4.prototype.set = listCacheSet;
|
213
|
+
|
214
|
+
var _ListCache = ListCache$4;
|
215
|
+
|
216
|
+
var ListCache$3 = _ListCache;
|
217
|
+
|
218
|
+
/**
|
219
|
+
* Removes all key-value entries from the stack.
|
220
|
+
*
|
221
|
+
* @private
|
222
|
+
* @name clear
|
223
|
+
* @memberOf Stack
|
224
|
+
*/
|
225
|
+
function stackClear$1() {
|
226
|
+
this.__data__ = new ListCache$3;
|
227
|
+
this.size = 0;
|
228
|
+
}
|
229
|
+
|
230
|
+
var _stackClear = stackClear$1;
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Removes `key` and its value from the stack.
|
234
|
+
*
|
235
|
+
* @private
|
236
|
+
* @name delete
|
237
|
+
* @memberOf Stack
|
238
|
+
* @param {string} key The key of the value to remove.
|
239
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
240
|
+
*/
|
241
|
+
|
242
|
+
function stackDelete$1(key) {
|
243
|
+
var data = this.__data__,
|
244
|
+
result = data['delete'](key);
|
245
|
+
|
246
|
+
this.size = data.size;
|
247
|
+
return result;
|
248
|
+
}
|
249
|
+
|
250
|
+
var _stackDelete = stackDelete$1;
|
251
|
+
|
252
|
+
/**
|
253
|
+
* Gets the stack value for `key`.
|
254
|
+
*
|
255
|
+
* @private
|
256
|
+
* @name get
|
257
|
+
* @memberOf Stack
|
258
|
+
* @param {string} key The key of the value to get.
|
259
|
+
* @returns {*} Returns the entry value.
|
260
|
+
*/
|
261
|
+
|
262
|
+
function stackGet$1(key) {
|
263
|
+
return this.__data__.get(key);
|
264
|
+
}
|
265
|
+
|
266
|
+
var _stackGet = stackGet$1;
|
267
|
+
|
268
|
+
/**
|
269
|
+
* Checks if a stack value for `key` exists.
|
270
|
+
*
|
271
|
+
* @private
|
272
|
+
* @name has
|
273
|
+
* @memberOf Stack
|
274
|
+
* @param {string} key The key of the entry to check.
|
275
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
276
|
+
*/
|
277
|
+
|
278
|
+
function stackHas$1(key) {
|
279
|
+
return this.__data__.has(key);
|
280
|
+
}
|
281
|
+
|
282
|
+
var _stackHas = stackHas$1;
|
283
|
+
|
284
|
+
/** Detect free variable `global` from Node.js. */
|
285
|
+
|
286
|
+
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
287
|
+
|
288
|
+
var _freeGlobal = freeGlobal$1;
|
289
|
+
|
290
|
+
var freeGlobal = _freeGlobal;
|
291
|
+
|
292
|
+
/** Detect free variable `self`. */
|
293
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
294
|
+
|
295
|
+
/** Used as a reference to the global object. */
|
296
|
+
var root$8 = freeGlobal || freeSelf || Function('return this')();
|
297
|
+
|
298
|
+
var _root = root$8;
|
299
|
+
|
300
|
+
var root$7 = _root;
|
301
|
+
|
302
|
+
/** Built-in value references. */
|
303
|
+
var Symbol$3 = root$7.Symbol;
|
304
|
+
|
305
|
+
var _Symbol = Symbol$3;
|
306
|
+
|
307
|
+
var Symbol$2 = _Symbol;
|
308
|
+
|
309
|
+
/** Used for built-in method references. */
|
310
|
+
var objectProto$b = Object.prototype;
|
311
|
+
|
312
|
+
/** Used to check objects for own properties. */
|
313
|
+
var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
|
314
|
+
|
315
|
+
/**
|
316
|
+
* Used to resolve the
|
317
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
318
|
+
* of values.
|
319
|
+
*/
|
320
|
+
var nativeObjectToString$1 = objectProto$b.toString;
|
321
|
+
|
322
|
+
/** Built-in value references. */
|
323
|
+
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
324
|
+
|
325
|
+
/**
|
326
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
327
|
+
*
|
328
|
+
* @private
|
329
|
+
* @param {*} value The value to query.
|
330
|
+
* @returns {string} Returns the raw `toStringTag`.
|
331
|
+
*/
|
332
|
+
function getRawTag$1(value) {
|
333
|
+
var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
|
334
|
+
tag = value[symToStringTag$1];
|
335
|
+
|
336
|
+
try {
|
337
|
+
value[symToStringTag$1] = undefined;
|
338
|
+
var unmasked = true;
|
339
|
+
} catch (e) {}
|
340
|
+
|
341
|
+
var result = nativeObjectToString$1.call(value);
|
342
|
+
if (unmasked) {
|
343
|
+
if (isOwn) {
|
344
|
+
value[symToStringTag$1] = tag;
|
345
|
+
} else {
|
346
|
+
delete value[symToStringTag$1];
|
347
|
+
}
|
348
|
+
}
|
349
|
+
return result;
|
350
|
+
}
|
351
|
+
|
352
|
+
var _getRawTag = getRawTag$1;
|
353
|
+
|
354
|
+
/** Used for built-in method references. */
|
355
|
+
|
356
|
+
var objectProto$a = Object.prototype;
|
357
|
+
|
358
|
+
/**
|
359
|
+
* Used to resolve the
|
360
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
361
|
+
* of values.
|
362
|
+
*/
|
363
|
+
var nativeObjectToString = objectProto$a.toString;
|
364
|
+
|
365
|
+
/**
|
366
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
367
|
+
*
|
368
|
+
* @private
|
369
|
+
* @param {*} value The value to convert.
|
370
|
+
* @returns {string} Returns the converted string.
|
371
|
+
*/
|
372
|
+
function objectToString$1(value) {
|
373
|
+
return nativeObjectToString.call(value);
|
374
|
+
}
|
375
|
+
|
376
|
+
var _objectToString = objectToString$1;
|
377
|
+
|
378
|
+
var Symbol$1 = _Symbol,
|
379
|
+
getRawTag = _getRawTag,
|
380
|
+
objectToString = _objectToString;
|
381
|
+
|
382
|
+
/** `Object#toString` result references. */
|
383
|
+
var nullTag = '[object Null]',
|
384
|
+
undefinedTag = '[object Undefined]';
|
385
|
+
|
386
|
+
/** Built-in value references. */
|
387
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
388
|
+
|
389
|
+
/**
|
390
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
391
|
+
*
|
392
|
+
* @private
|
393
|
+
* @param {*} value The value to query.
|
394
|
+
* @returns {string} Returns the `toStringTag`.
|
395
|
+
*/
|
396
|
+
function baseGetTag$4(value) {
|
397
|
+
if (value == null) {
|
398
|
+
return value === undefined ? undefinedTag : nullTag;
|
399
|
+
}
|
400
|
+
return (symToStringTag && symToStringTag in Object(value))
|
401
|
+
? getRawTag(value)
|
402
|
+
: objectToString(value);
|
403
|
+
}
|
404
|
+
|
405
|
+
var _baseGetTag = baseGetTag$4;
|
406
|
+
|
407
|
+
/**
|
408
|
+
* Checks if `value` is the
|
409
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
410
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
411
|
+
*
|
412
|
+
* @static
|
413
|
+
* @memberOf _
|
414
|
+
* @since 0.1.0
|
415
|
+
* @category Lang
|
416
|
+
* @param {*} value The value to check.
|
417
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
418
|
+
* @example
|
419
|
+
*
|
420
|
+
* _.isObject({});
|
421
|
+
* // => true
|
422
|
+
*
|
423
|
+
* _.isObject([1, 2, 3]);
|
424
|
+
* // => true
|
425
|
+
*
|
426
|
+
* _.isObject(_.noop);
|
427
|
+
* // => true
|
428
|
+
*
|
429
|
+
* _.isObject(null);
|
430
|
+
* // => false
|
431
|
+
*/
|
432
|
+
|
433
|
+
function isObject$2(value) {
|
434
|
+
var type = typeof value;
|
435
|
+
return value != null && (type == 'object' || type == 'function');
|
436
|
+
}
|
437
|
+
|
438
|
+
var isObject_1 = isObject$2;
|
439
|
+
|
440
|
+
var baseGetTag$3 = _baseGetTag,
|
441
|
+
isObject$1 = isObject_1;
|
442
|
+
|
443
|
+
/** `Object#toString` result references. */
|
444
|
+
var asyncTag = '[object AsyncFunction]',
|
445
|
+
funcTag$1 = '[object Function]',
|
446
|
+
genTag = '[object GeneratorFunction]',
|
447
|
+
proxyTag = '[object Proxy]';
|
448
|
+
|
449
|
+
/**
|
450
|
+
* Checks if `value` is classified as a `Function` object.
|
451
|
+
*
|
452
|
+
* @static
|
453
|
+
* @memberOf _
|
454
|
+
* @since 0.1.0
|
455
|
+
* @category Lang
|
456
|
+
* @param {*} value The value to check.
|
457
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
458
|
+
* @example
|
459
|
+
*
|
460
|
+
* _.isFunction(_);
|
461
|
+
* // => true
|
462
|
+
*
|
463
|
+
* _.isFunction(/abc/);
|
464
|
+
* // => false
|
465
|
+
*/
|
466
|
+
function isFunction$2(value) {
|
467
|
+
if (!isObject$1(value)) {
|
468
|
+
return false;
|
469
|
+
}
|
470
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
471
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
472
|
+
var tag = baseGetTag$3(value);
|
473
|
+
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
474
|
+
}
|
475
|
+
|
476
|
+
var isFunction_1 = isFunction$2;
|
477
|
+
|
478
|
+
var root$6 = _root;
|
479
|
+
|
480
|
+
/** Used to detect overreaching core-js shims. */
|
481
|
+
var coreJsData$1 = root$6['__core-js_shared__'];
|
482
|
+
|
483
|
+
var _coreJsData = coreJsData$1;
|
484
|
+
|
485
|
+
var coreJsData = _coreJsData;
|
486
|
+
|
487
|
+
/** Used to detect methods masquerading as native. */
|
488
|
+
var maskSrcKey = (function() {
|
489
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
490
|
+
return uid ? ('Symbol(src)_1.' + uid) : '';
|
491
|
+
}());
|
492
|
+
|
493
|
+
/**
|
494
|
+
* Checks if `func` has its source masked.
|
495
|
+
*
|
496
|
+
* @private
|
497
|
+
* @param {Function} func The function to check.
|
498
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
499
|
+
*/
|
500
|
+
function isMasked$1(func) {
|
501
|
+
return !!maskSrcKey && (maskSrcKey in func);
|
502
|
+
}
|
503
|
+
|
504
|
+
var _isMasked = isMasked$1;
|
505
|
+
|
506
|
+
/** Used for built-in method references. */
|
507
|
+
|
508
|
+
var funcProto$1 = Function.prototype;
|
509
|
+
|
510
|
+
/** Used to resolve the decompiled source of functions. */
|
511
|
+
var funcToString$1 = funcProto$1.toString;
|
512
|
+
|
513
|
+
/**
|
514
|
+
* Converts `func` to its source code.
|
515
|
+
*
|
516
|
+
* @private
|
517
|
+
* @param {Function} func The function to convert.
|
518
|
+
* @returns {string} Returns the source code.
|
519
|
+
*/
|
520
|
+
function toSource$2(func) {
|
521
|
+
if (func != null) {
|
522
|
+
try {
|
523
|
+
return funcToString$1.call(func);
|
524
|
+
} catch (e) {}
|
525
|
+
try {
|
526
|
+
return (func + '');
|
527
|
+
} catch (e) {}
|
528
|
+
}
|
529
|
+
return '';
|
530
|
+
}
|
531
|
+
|
532
|
+
var _toSource = toSource$2;
|
533
|
+
|
534
|
+
var isFunction$1 = isFunction_1,
|
535
|
+
isMasked = _isMasked,
|
536
|
+
isObject = isObject_1,
|
537
|
+
toSource$1 = _toSource;
|
538
|
+
|
539
|
+
/**
|
540
|
+
* Used to match `RegExp`
|
541
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
542
|
+
*/
|
543
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
544
|
+
|
545
|
+
/** Used to detect host constructors (Safari). */
|
546
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
547
|
+
|
548
|
+
/** Used for built-in method references. */
|
549
|
+
var funcProto = Function.prototype,
|
550
|
+
objectProto$9 = Object.prototype;
|
551
|
+
|
552
|
+
/** Used to resolve the decompiled source of functions. */
|
553
|
+
var funcToString = funcProto.toString;
|
554
|
+
|
555
|
+
/** Used to check objects for own properties. */
|
556
|
+
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
557
|
+
|
558
|
+
/** Used to detect if a method is native. */
|
559
|
+
var reIsNative = RegExp('^' +
|
560
|
+
funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
|
561
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
562
|
+
);
|
563
|
+
|
564
|
+
/**
|
565
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
566
|
+
*
|
567
|
+
* @private
|
568
|
+
* @param {*} value The value to check.
|
569
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
570
|
+
* else `false`.
|
571
|
+
*/
|
572
|
+
function baseIsNative$1(value) {
|
573
|
+
if (!isObject(value) || isMasked(value)) {
|
574
|
+
return false;
|
575
|
+
}
|
576
|
+
var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
|
577
|
+
return pattern.test(toSource$1(value));
|
578
|
+
}
|
579
|
+
|
580
|
+
var _baseIsNative = baseIsNative$1;
|
581
|
+
|
582
|
+
/**
|
583
|
+
* Gets the value at `key` of `object`.
|
584
|
+
*
|
585
|
+
* @private
|
586
|
+
* @param {Object} [object] The object to query.
|
587
|
+
* @param {string} key The key of the property to get.
|
588
|
+
* @returns {*} Returns the property value.
|
589
|
+
*/
|
590
|
+
|
591
|
+
function getValue$1(object, key) {
|
592
|
+
return object == null ? undefined : object[key];
|
593
|
+
}
|
594
|
+
|
595
|
+
var _getValue = getValue$1;
|
596
|
+
|
597
|
+
var baseIsNative = _baseIsNative,
|
598
|
+
getValue = _getValue;
|
599
|
+
|
600
|
+
/**
|
601
|
+
* Gets the native function at `key` of `object`.
|
602
|
+
*
|
603
|
+
* @private
|
604
|
+
* @param {Object} object The object to query.
|
605
|
+
* @param {string} key The key of the method to get.
|
606
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
607
|
+
*/
|
608
|
+
function getNative$6(object, key) {
|
609
|
+
var value = getValue(object, key);
|
610
|
+
return baseIsNative(value) ? value : undefined;
|
611
|
+
}
|
612
|
+
|
613
|
+
var _getNative = getNative$6;
|
614
|
+
|
615
|
+
var getNative$5 = _getNative,
|
616
|
+
root$5 = _root;
|
617
|
+
|
618
|
+
/* Built-in method references that are verified to be native. */
|
619
|
+
var Map$4 = getNative$5(root$5, 'Map');
|
620
|
+
|
621
|
+
var _Map = Map$4;
|
622
|
+
|
623
|
+
var getNative$4 = _getNative;
|
624
|
+
|
625
|
+
/* Built-in method references that are verified to be native. */
|
626
|
+
var nativeCreate$4 = getNative$4(Object, 'create');
|
627
|
+
|
628
|
+
var _nativeCreate = nativeCreate$4;
|
629
|
+
|
630
|
+
var nativeCreate$3 = _nativeCreate;
|
631
|
+
|
632
|
+
/**
|
633
|
+
* Removes all key-value entries from the hash.
|
634
|
+
*
|
635
|
+
* @private
|
636
|
+
* @name clear
|
637
|
+
* @memberOf Hash
|
638
|
+
*/
|
639
|
+
function hashClear$1() {
|
640
|
+
this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
|
641
|
+
this.size = 0;
|
642
|
+
}
|
643
|
+
|
644
|
+
var _hashClear = hashClear$1;
|
645
|
+
|
646
|
+
/**
|
647
|
+
* Removes `key` and its value from the hash.
|
648
|
+
*
|
649
|
+
* @private
|
650
|
+
* @name delete
|
651
|
+
* @memberOf Hash
|
652
|
+
* @param {Object} hash The hash to modify.
|
653
|
+
* @param {string} key The key of the value to remove.
|
654
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
655
|
+
*/
|
656
|
+
|
657
|
+
function hashDelete$1(key) {
|
658
|
+
var result = this.has(key) && delete this.__data__[key];
|
659
|
+
this.size -= result ? 1 : 0;
|
660
|
+
return result;
|
661
|
+
}
|
662
|
+
|
663
|
+
var _hashDelete = hashDelete$1;
|
664
|
+
|
665
|
+
var nativeCreate$2 = _nativeCreate;
|
666
|
+
|
667
|
+
/** Used to stand-in for `undefined` hash values. */
|
668
|
+
var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
|
669
|
+
|
670
|
+
/** Used for built-in method references. */
|
671
|
+
var objectProto$8 = Object.prototype;
|
672
|
+
|
673
|
+
/** Used to check objects for own properties. */
|
674
|
+
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
675
|
+
|
676
|
+
/**
|
677
|
+
* Gets the hash value for `key`.
|
678
|
+
*
|
679
|
+
* @private
|
680
|
+
* @name get
|
681
|
+
* @memberOf Hash
|
682
|
+
* @param {string} key The key of the value to get.
|
683
|
+
* @returns {*} Returns the entry value.
|
684
|
+
*/
|
685
|
+
function hashGet$1(key) {
|
686
|
+
var data = this.__data__;
|
687
|
+
if (nativeCreate$2) {
|
688
|
+
var result = data[key];
|
689
|
+
return result === HASH_UNDEFINED$2 ? undefined : result;
|
690
|
+
}
|
691
|
+
return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
|
692
|
+
}
|
693
|
+
|
694
|
+
var _hashGet = hashGet$1;
|
695
|
+
|
696
|
+
var nativeCreate$1 = _nativeCreate;
|
697
|
+
|
698
|
+
/** Used for built-in method references. */
|
699
|
+
var objectProto$7 = Object.prototype;
|
700
|
+
|
701
|
+
/** Used to check objects for own properties. */
|
702
|
+
var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
|
703
|
+
|
704
|
+
/**
|
705
|
+
* Checks if a hash value for `key` exists.
|
706
|
+
*
|
707
|
+
* @private
|
708
|
+
* @name has
|
709
|
+
* @memberOf Hash
|
710
|
+
* @param {string} key The key of the entry to check.
|
711
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
712
|
+
*/
|
713
|
+
function hashHas$1(key) {
|
714
|
+
var data = this.__data__;
|
715
|
+
return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty$5.call(data, key);
|
716
|
+
}
|
717
|
+
|
718
|
+
var _hashHas = hashHas$1;
|
719
|
+
|
720
|
+
var nativeCreate = _nativeCreate;
|
721
|
+
|
722
|
+
/** Used to stand-in for `undefined` hash values. */
|
723
|
+
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
724
|
+
|
725
|
+
/**
|
726
|
+
* Sets the hash `key` to `value`.
|
727
|
+
*
|
728
|
+
* @private
|
729
|
+
* @name set
|
730
|
+
* @memberOf Hash
|
731
|
+
* @param {string} key The key of the value to set.
|
732
|
+
* @param {*} value The value to set.
|
733
|
+
* @returns {Object} Returns the hash instance.
|
734
|
+
*/
|
735
|
+
function hashSet$1(key, value) {
|
736
|
+
var data = this.__data__;
|
737
|
+
this.size += this.has(key) ? 0 : 1;
|
738
|
+
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
|
739
|
+
return this;
|
740
|
+
}
|
741
|
+
|
742
|
+
var _hashSet = hashSet$1;
|
743
|
+
|
744
|
+
var hashClear = _hashClear,
|
745
|
+
hashDelete = _hashDelete,
|
746
|
+
hashGet = _hashGet,
|
747
|
+
hashHas = _hashHas,
|
748
|
+
hashSet = _hashSet;
|
749
|
+
|
750
|
+
/**
|
751
|
+
* Creates a hash object.
|
752
|
+
*
|
753
|
+
* @private
|
754
|
+
* @constructor
|
755
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
756
|
+
*/
|
757
|
+
function Hash$1(entries) {
|
758
|
+
var index = -1,
|
759
|
+
length = entries == null ? 0 : entries.length;
|
760
|
+
|
761
|
+
this.clear();
|
762
|
+
while (++index < length) {
|
763
|
+
var entry = entries[index];
|
764
|
+
this.set(entry[0], entry[1]);
|
765
|
+
}
|
766
|
+
}
|
767
|
+
|
768
|
+
// Add methods to `Hash`.
|
769
|
+
Hash$1.prototype.clear = hashClear;
|
770
|
+
Hash$1.prototype['delete'] = hashDelete;
|
771
|
+
Hash$1.prototype.get = hashGet;
|
772
|
+
Hash$1.prototype.has = hashHas;
|
773
|
+
Hash$1.prototype.set = hashSet;
|
774
|
+
|
775
|
+
var _Hash = Hash$1;
|
776
|
+
|
777
|
+
var Hash = _Hash,
|
778
|
+
ListCache$2 = _ListCache,
|
779
|
+
Map$3 = _Map;
|
780
|
+
|
781
|
+
/**
|
782
|
+
* Removes all key-value entries from the map.
|
783
|
+
*
|
784
|
+
* @private
|
785
|
+
* @name clear
|
786
|
+
* @memberOf MapCache
|
787
|
+
*/
|
788
|
+
function mapCacheClear$1() {
|
789
|
+
this.size = 0;
|
790
|
+
this.__data__ = {
|
791
|
+
'hash': new Hash,
|
792
|
+
'map': new (Map$3 || ListCache$2),
|
793
|
+
'string': new Hash
|
794
|
+
};
|
795
|
+
}
|
796
|
+
|
797
|
+
var _mapCacheClear = mapCacheClear$1;
|
798
|
+
|
799
|
+
/**
|
800
|
+
* Checks if `value` is suitable for use as unique object key.
|
801
|
+
*
|
802
|
+
* @private
|
803
|
+
* @param {*} value The value to check.
|
804
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
805
|
+
*/
|
806
|
+
|
807
|
+
function isKeyable$1(value) {
|
808
|
+
var type = typeof value;
|
809
|
+
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
810
|
+
? (value !== '__proto__')
|
811
|
+
: (value === null);
|
812
|
+
}
|
813
|
+
|
814
|
+
var _isKeyable = isKeyable$1;
|
815
|
+
|
816
|
+
var isKeyable = _isKeyable;
|
817
|
+
|
818
|
+
/**
|
819
|
+
* Gets the data for `map`.
|
820
|
+
*
|
821
|
+
* @private
|
822
|
+
* @param {Object} map The map to query.
|
823
|
+
* @param {string} key The reference key.
|
824
|
+
* @returns {*} Returns the map data.
|
825
|
+
*/
|
826
|
+
function getMapData$4(map, key) {
|
827
|
+
var data = map.__data__;
|
828
|
+
return isKeyable(key)
|
829
|
+
? data[typeof key == 'string' ? 'string' : 'hash']
|
830
|
+
: data.map;
|
831
|
+
}
|
832
|
+
|
833
|
+
var _getMapData = getMapData$4;
|
834
|
+
|
835
|
+
var getMapData$3 = _getMapData;
|
836
|
+
|
837
|
+
/**
|
838
|
+
* Removes `key` and its value from the map.
|
839
|
+
*
|
840
|
+
* @private
|
841
|
+
* @name delete
|
842
|
+
* @memberOf MapCache
|
843
|
+
* @param {string} key The key of the value to remove.
|
844
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
845
|
+
*/
|
846
|
+
function mapCacheDelete$1(key) {
|
847
|
+
var result = getMapData$3(this, key)['delete'](key);
|
848
|
+
this.size -= result ? 1 : 0;
|
849
|
+
return result;
|
850
|
+
}
|
851
|
+
|
852
|
+
var _mapCacheDelete = mapCacheDelete$1;
|
853
|
+
|
854
|
+
var getMapData$2 = _getMapData;
|
855
|
+
|
856
|
+
/**
|
857
|
+
* Gets the map value for `key`.
|
858
|
+
*
|
859
|
+
* @private
|
860
|
+
* @name get
|
861
|
+
* @memberOf MapCache
|
862
|
+
* @param {string} key The key of the value to get.
|
863
|
+
* @returns {*} Returns the entry value.
|
864
|
+
*/
|
865
|
+
function mapCacheGet$1(key) {
|
866
|
+
return getMapData$2(this, key).get(key);
|
867
|
+
}
|
868
|
+
|
869
|
+
var _mapCacheGet = mapCacheGet$1;
|
870
|
+
|
871
|
+
var getMapData$1 = _getMapData;
|
872
|
+
|
873
|
+
/**
|
874
|
+
* Checks if a map value for `key` exists.
|
875
|
+
*
|
876
|
+
* @private
|
877
|
+
* @name has
|
878
|
+
* @memberOf MapCache
|
879
|
+
* @param {string} key The key of the entry to check.
|
880
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
881
|
+
*/
|
882
|
+
function mapCacheHas$1(key) {
|
883
|
+
return getMapData$1(this, key).has(key);
|
884
|
+
}
|
885
|
+
|
886
|
+
var _mapCacheHas = mapCacheHas$1;
|
887
|
+
|
888
|
+
var getMapData = _getMapData;
|
889
|
+
|
890
|
+
/**
|
891
|
+
* Sets the map `key` to `value`.
|
892
|
+
*
|
893
|
+
* @private
|
894
|
+
* @name set
|
895
|
+
* @memberOf MapCache
|
896
|
+
* @param {string} key The key of the value to set.
|
897
|
+
* @param {*} value The value to set.
|
898
|
+
* @returns {Object} Returns the map cache instance.
|
899
|
+
*/
|
900
|
+
function mapCacheSet$1(key, value) {
|
901
|
+
var data = getMapData(this, key),
|
902
|
+
size = data.size;
|
903
|
+
|
904
|
+
data.set(key, value);
|
905
|
+
this.size += data.size == size ? 0 : 1;
|
906
|
+
return this;
|
907
|
+
}
|
908
|
+
|
909
|
+
var _mapCacheSet = mapCacheSet$1;
|
910
|
+
|
911
|
+
var mapCacheClear = _mapCacheClear,
|
912
|
+
mapCacheDelete = _mapCacheDelete,
|
913
|
+
mapCacheGet = _mapCacheGet,
|
914
|
+
mapCacheHas = _mapCacheHas,
|
915
|
+
mapCacheSet = _mapCacheSet;
|
916
|
+
|
917
|
+
/**
|
918
|
+
* Creates a map cache object to store key-value pairs.
|
919
|
+
*
|
920
|
+
* @private
|
921
|
+
* @constructor
|
922
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
923
|
+
*/
|
924
|
+
function MapCache$2(entries) {
|
925
|
+
var index = -1,
|
926
|
+
length = entries == null ? 0 : entries.length;
|
927
|
+
|
928
|
+
this.clear();
|
929
|
+
while (++index < length) {
|
930
|
+
var entry = entries[index];
|
931
|
+
this.set(entry[0], entry[1]);
|
932
|
+
}
|
933
|
+
}
|
934
|
+
|
935
|
+
// Add methods to `MapCache`.
|
936
|
+
MapCache$2.prototype.clear = mapCacheClear;
|
937
|
+
MapCache$2.prototype['delete'] = mapCacheDelete;
|
938
|
+
MapCache$2.prototype.get = mapCacheGet;
|
939
|
+
MapCache$2.prototype.has = mapCacheHas;
|
940
|
+
MapCache$2.prototype.set = mapCacheSet;
|
941
|
+
|
942
|
+
var _MapCache = MapCache$2;
|
943
|
+
|
944
|
+
var ListCache$1 = _ListCache,
|
945
|
+
Map$2 = _Map,
|
946
|
+
MapCache$1 = _MapCache;
|
947
|
+
|
948
|
+
/** Used as the size to enable large array optimizations. */
|
949
|
+
var LARGE_ARRAY_SIZE = 200;
|
950
|
+
|
951
|
+
/**
|
952
|
+
* Sets the stack `key` to `value`.
|
953
|
+
*
|
954
|
+
* @private
|
955
|
+
* @name set
|
956
|
+
* @memberOf Stack
|
957
|
+
* @param {string} key The key of the value to set.
|
958
|
+
* @param {*} value The value to set.
|
959
|
+
* @returns {Object} Returns the stack cache instance.
|
960
|
+
*/
|
961
|
+
function stackSet$1(key, value) {
|
962
|
+
var data = this.__data__;
|
963
|
+
if (data instanceof ListCache$1) {
|
964
|
+
var pairs = data.__data__;
|
965
|
+
if (!Map$2 || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
966
|
+
pairs.push([key, value]);
|
967
|
+
this.size = ++data.size;
|
968
|
+
return this;
|
969
|
+
}
|
970
|
+
data = this.__data__ = new MapCache$1(pairs);
|
971
|
+
}
|
972
|
+
data.set(key, value);
|
973
|
+
this.size = data.size;
|
974
|
+
return this;
|
975
|
+
}
|
976
|
+
|
977
|
+
var _stackSet = stackSet$1;
|
978
|
+
|
979
|
+
var ListCache = _ListCache,
|
980
|
+
stackClear = _stackClear,
|
981
|
+
stackDelete = _stackDelete,
|
982
|
+
stackGet = _stackGet,
|
983
|
+
stackHas = _stackHas,
|
984
|
+
stackSet = _stackSet;
|
985
|
+
|
986
|
+
/**
|
987
|
+
* Creates a stack cache object to store key-value pairs.
|
988
|
+
*
|
989
|
+
* @private
|
990
|
+
* @constructor
|
991
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
992
|
+
*/
|
993
|
+
function Stack$1(entries) {
|
994
|
+
var data = this.__data__ = new ListCache(entries);
|
995
|
+
this.size = data.size;
|
996
|
+
}
|
997
|
+
|
998
|
+
// Add methods to `Stack`.
|
999
|
+
Stack$1.prototype.clear = stackClear;
|
1000
|
+
Stack$1.prototype['delete'] = stackDelete;
|
1001
|
+
Stack$1.prototype.get = stackGet;
|
1002
|
+
Stack$1.prototype.has = stackHas;
|
1003
|
+
Stack$1.prototype.set = stackSet;
|
1004
|
+
|
1005
|
+
var _Stack = Stack$1;
|
1006
|
+
|
1007
|
+
/** Used to stand-in for `undefined` hash values. */
|
1008
|
+
|
1009
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
1010
|
+
|
1011
|
+
/**
|
1012
|
+
* Adds `value` to the array cache.
|
1013
|
+
*
|
1014
|
+
* @private
|
1015
|
+
* @name add
|
1016
|
+
* @memberOf SetCache
|
1017
|
+
* @alias push
|
1018
|
+
* @param {*} value The value to cache.
|
1019
|
+
* @returns {Object} Returns the cache instance.
|
1020
|
+
*/
|
1021
|
+
function setCacheAdd$1(value) {
|
1022
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
1023
|
+
return this;
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
var _setCacheAdd = setCacheAdd$1;
|
1027
|
+
|
1028
|
+
/**
|
1029
|
+
* Checks if `value` is in the array cache.
|
1030
|
+
*
|
1031
|
+
* @private
|
1032
|
+
* @name has
|
1033
|
+
* @memberOf SetCache
|
1034
|
+
* @param {*} value The value to search for.
|
1035
|
+
* @returns {number} Returns `true` if `value` is found, else `false`.
|
1036
|
+
*/
|
1037
|
+
|
1038
|
+
function setCacheHas$1(value) {
|
1039
|
+
return this.__data__.has(value);
|
1040
|
+
}
|
1041
|
+
|
1042
|
+
var _setCacheHas = setCacheHas$1;
|
1043
|
+
|
1044
|
+
var MapCache = _MapCache,
|
1045
|
+
setCacheAdd = _setCacheAdd,
|
1046
|
+
setCacheHas = _setCacheHas;
|
1047
|
+
|
1048
|
+
/**
|
1049
|
+
*
|
1050
|
+
* Creates an array cache object to store unique values.
|
1051
|
+
*
|
1052
|
+
* @private
|
1053
|
+
* @constructor
|
1054
|
+
* @param {Array} [values] The values to cache.
|
1055
|
+
*/
|
1056
|
+
function SetCache$1(values) {
|
1057
|
+
var index = -1,
|
1058
|
+
length = values == null ? 0 : values.length;
|
1059
|
+
|
1060
|
+
this.__data__ = new MapCache;
|
1061
|
+
while (++index < length) {
|
1062
|
+
this.add(values[index]);
|
1063
|
+
}
|
1064
|
+
}
|
1065
|
+
|
1066
|
+
// Add methods to `SetCache`.
|
1067
|
+
SetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;
|
1068
|
+
SetCache$1.prototype.has = setCacheHas;
|
1069
|
+
|
1070
|
+
var _SetCache = SetCache$1;
|
1071
|
+
|
1072
|
+
/**
|
1073
|
+
* A specialized version of `_.some` for arrays without support for iteratee
|
1074
|
+
* shorthands.
|
1075
|
+
*
|
1076
|
+
* @private
|
1077
|
+
* @param {Array} [array] The array to iterate over.
|
1078
|
+
* @param {Function} predicate The function invoked per iteration.
|
1079
|
+
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
1080
|
+
* else `false`.
|
1081
|
+
*/
|
1082
|
+
|
1083
|
+
function arraySome$1(array, predicate) {
|
1084
|
+
var index = -1,
|
1085
|
+
length = array == null ? 0 : array.length;
|
1086
|
+
|
1087
|
+
while (++index < length) {
|
1088
|
+
if (predicate(array[index], index, array)) {
|
1089
|
+
return true;
|
1090
|
+
}
|
1091
|
+
}
|
1092
|
+
return false;
|
1093
|
+
}
|
1094
|
+
|
1095
|
+
var _arraySome = arraySome$1;
|
1096
|
+
|
1097
|
+
/**
|
1098
|
+
* Checks if a `cache` value for `key` exists.
|
1099
|
+
*
|
1100
|
+
* @private
|
1101
|
+
* @param {Object} cache The cache to query.
|
1102
|
+
* @param {string} key The key of the entry to check.
|
1103
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
1104
|
+
*/
|
1105
|
+
|
1106
|
+
function cacheHas$1(cache, key) {
|
1107
|
+
return cache.has(key);
|
1108
|
+
}
|
1109
|
+
|
1110
|
+
var _cacheHas = cacheHas$1;
|
1111
|
+
|
1112
|
+
var SetCache = _SetCache,
|
1113
|
+
arraySome = _arraySome,
|
1114
|
+
cacheHas = _cacheHas;
|
1115
|
+
|
1116
|
+
/** Used to compose bitmasks for value comparisons. */
|
1117
|
+
var COMPARE_PARTIAL_FLAG$3 = 1,
|
1118
|
+
COMPARE_UNORDERED_FLAG$1 = 2;
|
1119
|
+
|
1120
|
+
/**
|
1121
|
+
* A specialized version of `baseIsEqualDeep` for arrays with support for
|
1122
|
+
* partial deep comparisons.
|
1123
|
+
*
|
1124
|
+
* @private
|
1125
|
+
* @param {Array} array The array to compare.
|
1126
|
+
* @param {Array} other The other array to compare.
|
1127
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
1128
|
+
* @param {Function} customizer The function to customize comparisons.
|
1129
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
1130
|
+
* @param {Object} stack Tracks traversed `array` and `other` objects.
|
1131
|
+
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
1132
|
+
*/
|
1133
|
+
function equalArrays$2(array, other, bitmask, customizer, equalFunc, stack) {
|
1134
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
|
1135
|
+
arrLength = array.length,
|
1136
|
+
othLength = other.length;
|
1137
|
+
|
1138
|
+
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
1139
|
+
return false;
|
1140
|
+
}
|
1141
|
+
// Check that cyclic values are equal.
|
1142
|
+
var arrStacked = stack.get(array);
|
1143
|
+
var othStacked = stack.get(other);
|
1144
|
+
if (arrStacked && othStacked) {
|
1145
|
+
return arrStacked == other && othStacked == array;
|
1146
|
+
}
|
1147
|
+
var index = -1,
|
1148
|
+
result = true,
|
1149
|
+
seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new SetCache : undefined;
|
1150
|
+
|
1151
|
+
stack.set(array, other);
|
1152
|
+
stack.set(other, array);
|
1153
|
+
|
1154
|
+
// Ignore non-index properties.
|
1155
|
+
while (++index < arrLength) {
|
1156
|
+
var arrValue = array[index],
|
1157
|
+
othValue = other[index];
|
1158
|
+
|
1159
|
+
if (customizer) {
|
1160
|
+
var compared = isPartial
|
1161
|
+
? customizer(othValue, arrValue, index, other, array, stack)
|
1162
|
+
: customizer(arrValue, othValue, index, array, other, stack);
|
1163
|
+
}
|
1164
|
+
if (compared !== undefined) {
|
1165
|
+
if (compared) {
|
1166
|
+
continue;
|
1167
|
+
}
|
1168
|
+
result = false;
|
1169
|
+
break;
|
1170
|
+
}
|
1171
|
+
// Recursively compare arrays (susceptible to call stack limits).
|
1172
|
+
if (seen) {
|
1173
|
+
if (!arraySome(other, function(othValue, othIndex) {
|
1174
|
+
if (!cacheHas(seen, othIndex) &&
|
1175
|
+
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
1176
|
+
return seen.push(othIndex);
|
1177
|
+
}
|
1178
|
+
})) {
|
1179
|
+
result = false;
|
1180
|
+
break;
|
1181
|
+
}
|
1182
|
+
} else if (!(
|
1183
|
+
arrValue === othValue ||
|
1184
|
+
equalFunc(arrValue, othValue, bitmask, customizer, stack)
|
1185
|
+
)) {
|
1186
|
+
result = false;
|
1187
|
+
break;
|
1188
|
+
}
|
1189
|
+
}
|
1190
|
+
stack['delete'](array);
|
1191
|
+
stack['delete'](other);
|
1192
|
+
return result;
|
1193
|
+
}
|
1194
|
+
|
1195
|
+
var _equalArrays = equalArrays$2;
|
1196
|
+
|
1197
|
+
var root$4 = _root;
|
1198
|
+
|
1199
|
+
/** Built-in value references. */
|
1200
|
+
var Uint8Array$1 = root$4.Uint8Array;
|
1201
|
+
|
1202
|
+
var _Uint8Array = Uint8Array$1;
|
1203
|
+
|
1204
|
+
/**
|
1205
|
+
* Converts `map` to its key-value pairs.
|
1206
|
+
*
|
1207
|
+
* @private
|
1208
|
+
* @param {Object} map The map to convert.
|
1209
|
+
* @returns {Array} Returns the key-value pairs.
|
1210
|
+
*/
|
1211
|
+
|
1212
|
+
function mapToArray$1(map) {
|
1213
|
+
var index = -1,
|
1214
|
+
result = Array(map.size);
|
1215
|
+
|
1216
|
+
map.forEach(function(value, key) {
|
1217
|
+
result[++index] = [key, value];
|
1218
|
+
});
|
1219
|
+
return result;
|
1220
|
+
}
|
1221
|
+
|
1222
|
+
var _mapToArray = mapToArray$1;
|
1223
|
+
|
1224
|
+
/**
|
1225
|
+
* Converts `set` to an array of its values.
|
1226
|
+
*
|
1227
|
+
* @private
|
1228
|
+
* @param {Object} set The set to convert.
|
1229
|
+
* @returns {Array} Returns the values.
|
1230
|
+
*/
|
1231
|
+
|
1232
|
+
function setToArray$1(set) {
|
1233
|
+
var index = -1,
|
1234
|
+
result = Array(set.size);
|
1235
|
+
|
1236
|
+
set.forEach(function(value) {
|
1237
|
+
result[++index] = value;
|
1238
|
+
});
|
1239
|
+
return result;
|
1240
|
+
}
|
1241
|
+
|
1242
|
+
var _setToArray = setToArray$1;
|
1243
|
+
|
1244
|
+
var Symbol = _Symbol,
|
1245
|
+
Uint8Array = _Uint8Array,
|
1246
|
+
eq = eq_1,
|
1247
|
+
equalArrays$1 = _equalArrays,
|
1248
|
+
mapToArray = _mapToArray,
|
1249
|
+
setToArray = _setToArray;
|
1250
|
+
|
1251
|
+
/** Used to compose bitmasks for value comparisons. */
|
1252
|
+
var COMPARE_PARTIAL_FLAG$2 = 1,
|
1253
|
+
COMPARE_UNORDERED_FLAG = 2;
|
1254
|
+
|
1255
|
+
/** `Object#toString` result references. */
|
1256
|
+
var boolTag$1 = '[object Boolean]',
|
1257
|
+
dateTag$1 = '[object Date]',
|
1258
|
+
errorTag$1 = '[object Error]',
|
1259
|
+
mapTag$2 = '[object Map]',
|
1260
|
+
numberTag$1 = '[object Number]',
|
1261
|
+
regexpTag$1 = '[object RegExp]',
|
1262
|
+
setTag$2 = '[object Set]',
|
1263
|
+
stringTag$1 = '[object String]',
|
1264
|
+
symbolTag = '[object Symbol]';
|
1265
|
+
|
1266
|
+
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
1267
|
+
dataViewTag$2 = '[object DataView]';
|
1268
|
+
|
1269
|
+
/** Used to convert symbols to primitives and strings. */
|
1270
|
+
var symbolProto = Symbol ? Symbol.prototype : undefined,
|
1271
|
+
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
1272
|
+
|
1273
|
+
/**
|
1274
|
+
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
1275
|
+
* the same `toStringTag`.
|
1276
|
+
*
|
1277
|
+
* **Note:** This function only supports comparing values with tags of
|
1278
|
+
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
|
1279
|
+
*
|
1280
|
+
* @private
|
1281
|
+
* @param {Object} object The object to compare.
|
1282
|
+
* @param {Object} other The other object to compare.
|
1283
|
+
* @param {string} tag The `toStringTag` of the objects to compare.
|
1284
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
1285
|
+
* @param {Function} customizer The function to customize comparisons.
|
1286
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
1287
|
+
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
1288
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
1289
|
+
*/
|
1290
|
+
function equalByTag$1(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
1291
|
+
switch (tag) {
|
1292
|
+
case dataViewTag$2:
|
1293
|
+
if ((object.byteLength != other.byteLength) ||
|
1294
|
+
(object.byteOffset != other.byteOffset)) {
|
1295
|
+
return false;
|
1296
|
+
}
|
1297
|
+
object = object.buffer;
|
1298
|
+
other = other.buffer;
|
1299
|
+
|
1300
|
+
case arrayBufferTag$1:
|
1301
|
+
if ((object.byteLength != other.byteLength) ||
|
1302
|
+
!equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
1303
|
+
return false;
|
1304
|
+
}
|
1305
|
+
return true;
|
1306
|
+
|
1307
|
+
case boolTag$1:
|
1308
|
+
case dateTag$1:
|
1309
|
+
case numberTag$1:
|
1310
|
+
// Coerce booleans to `1` or `0` and dates to milliseconds.
|
1311
|
+
// Invalid dates are coerced to `NaN`.
|
1312
|
+
return eq(+object, +other);
|
1313
|
+
|
1314
|
+
case errorTag$1:
|
1315
|
+
return object.name == other.name && object.message == other.message;
|
1316
|
+
|
1317
|
+
case regexpTag$1:
|
1318
|
+
case stringTag$1:
|
1319
|
+
// Coerce regexes to strings and treat strings, primitives and objects,
|
1320
|
+
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
|
1321
|
+
// for more details.
|
1322
|
+
return object == (other + '');
|
1323
|
+
|
1324
|
+
case mapTag$2:
|
1325
|
+
var convert = mapToArray;
|
1326
|
+
|
1327
|
+
case setTag$2:
|
1328
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
|
1329
|
+
convert || (convert = setToArray);
|
1330
|
+
|
1331
|
+
if (object.size != other.size && !isPartial) {
|
1332
|
+
return false;
|
1333
|
+
}
|
1334
|
+
// Assume cyclic values are equal.
|
1335
|
+
var stacked = stack.get(object);
|
1336
|
+
if (stacked) {
|
1337
|
+
return stacked == other;
|
1338
|
+
}
|
1339
|
+
bitmask |= COMPARE_UNORDERED_FLAG;
|
1340
|
+
|
1341
|
+
// Recursively compare objects (susceptible to call stack limits).
|
1342
|
+
stack.set(object, other);
|
1343
|
+
var result = equalArrays$1(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
1344
|
+
stack['delete'](object);
|
1345
|
+
return result;
|
1346
|
+
|
1347
|
+
case symbolTag:
|
1348
|
+
if (symbolValueOf) {
|
1349
|
+
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
1350
|
+
}
|
1351
|
+
}
|
1352
|
+
return false;
|
1353
|
+
}
|
1354
|
+
|
1355
|
+
var _equalByTag = equalByTag$1;
|
1356
|
+
|
1357
|
+
/**
|
1358
|
+
* Appends the elements of `values` to `array`.
|
1359
|
+
*
|
1360
|
+
* @private
|
1361
|
+
* @param {Array} array The array to modify.
|
1362
|
+
* @param {Array} values The values to append.
|
1363
|
+
* @returns {Array} Returns `array`.
|
1364
|
+
*/
|
1365
|
+
|
1366
|
+
function arrayPush$1(array, values) {
|
1367
|
+
var index = -1,
|
1368
|
+
length = values.length,
|
1369
|
+
offset = array.length;
|
1370
|
+
|
1371
|
+
while (++index < length) {
|
1372
|
+
array[offset + index] = values[index];
|
1373
|
+
}
|
1374
|
+
return array;
|
1375
|
+
}
|
1376
|
+
|
1377
|
+
var _arrayPush = arrayPush$1;
|
1378
|
+
|
1379
|
+
/**
|
1380
|
+
* Checks if `value` is classified as an `Array` object.
|
1381
|
+
*
|
1382
|
+
* @static
|
1383
|
+
* @memberOf _
|
1384
|
+
* @since 0.1.0
|
1385
|
+
* @category Lang
|
1386
|
+
* @param {*} value The value to check.
|
1387
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
1388
|
+
* @example
|
1389
|
+
*
|
1390
|
+
* _.isArray([1, 2, 3]);
|
1391
|
+
* // => true
|
1392
|
+
*
|
1393
|
+
* _.isArray(document.body.children);
|
1394
|
+
* // => false
|
1395
|
+
*
|
1396
|
+
* _.isArray('abc');
|
1397
|
+
* // => false
|
1398
|
+
*
|
1399
|
+
* _.isArray(_.noop);
|
1400
|
+
* // => false
|
1401
|
+
*/
|
1402
|
+
|
1403
|
+
var isArray$3 = Array.isArray;
|
1404
|
+
|
1405
|
+
var isArray_1 = isArray$3;
|
1406
|
+
|
1407
|
+
var arrayPush = _arrayPush,
|
1408
|
+
isArray$2 = isArray_1;
|
1409
|
+
|
1410
|
+
/**
|
1411
|
+
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
1412
|
+
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
1413
|
+
* symbols of `object`.
|
1414
|
+
*
|
1415
|
+
* @private
|
1416
|
+
* @param {Object} object The object to query.
|
1417
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
1418
|
+
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
1419
|
+
* @returns {Array} Returns the array of property names and symbols.
|
1420
|
+
*/
|
1421
|
+
function baseGetAllKeys$1(object, keysFunc, symbolsFunc) {
|
1422
|
+
var result = keysFunc(object);
|
1423
|
+
return isArray$2(object) ? result : arrayPush(result, symbolsFunc(object));
|
1424
|
+
}
|
1425
|
+
|
1426
|
+
var _baseGetAllKeys = baseGetAllKeys$1;
|
1427
|
+
|
1428
|
+
/**
|
1429
|
+
* A specialized version of `_.filter` for arrays without support for
|
1430
|
+
* iteratee shorthands.
|
1431
|
+
*
|
1432
|
+
* @private
|
1433
|
+
* @param {Array} [array] The array to iterate over.
|
1434
|
+
* @param {Function} predicate The function invoked per iteration.
|
1435
|
+
* @returns {Array} Returns the new filtered array.
|
1436
|
+
*/
|
1437
|
+
|
1438
|
+
function arrayFilter$1(array, predicate) {
|
1439
|
+
var index = -1,
|
1440
|
+
length = array == null ? 0 : array.length,
|
1441
|
+
resIndex = 0,
|
1442
|
+
result = [];
|
1443
|
+
|
1444
|
+
while (++index < length) {
|
1445
|
+
var value = array[index];
|
1446
|
+
if (predicate(value, index, array)) {
|
1447
|
+
result[resIndex++] = value;
|
1448
|
+
}
|
1449
|
+
}
|
1450
|
+
return result;
|
1451
|
+
}
|
1452
|
+
|
1453
|
+
var _arrayFilter = arrayFilter$1;
|
1454
|
+
|
1455
|
+
/**
|
1456
|
+
* This method returns a new empty array.
|
1457
|
+
*
|
1458
|
+
* @static
|
1459
|
+
* @memberOf _
|
1460
|
+
* @since 4.13.0
|
1461
|
+
* @category Util
|
1462
|
+
* @returns {Array} Returns the new empty array.
|
1463
|
+
* @example
|
1464
|
+
*
|
1465
|
+
* var arrays = _.times(2, _.stubArray);
|
1466
|
+
*
|
1467
|
+
* console.log(arrays);
|
1468
|
+
* // => [[], []]
|
1469
|
+
*
|
1470
|
+
* console.log(arrays[0] === arrays[1]);
|
1471
|
+
* // => false
|
1472
|
+
*/
|
1473
|
+
|
1474
|
+
function stubArray$1() {
|
1475
|
+
return [];
|
1476
|
+
}
|
1477
|
+
|
1478
|
+
var stubArray_1 = stubArray$1;
|
1479
|
+
|
1480
|
+
var arrayFilter = _arrayFilter,
|
1481
|
+
stubArray = stubArray_1;
|
1482
|
+
|
1483
|
+
/** Used for built-in method references. */
|
1484
|
+
var objectProto$6 = Object.prototype;
|
1485
|
+
|
1486
|
+
/** Built-in value references. */
|
1487
|
+
var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
|
1488
|
+
|
1489
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
1490
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
1491
|
+
|
1492
|
+
/**
|
1493
|
+
* Creates an array of the own enumerable symbols of `object`.
|
1494
|
+
*
|
1495
|
+
* @private
|
1496
|
+
* @param {Object} object The object to query.
|
1497
|
+
* @returns {Array} Returns the array of symbols.
|
1498
|
+
*/
|
1499
|
+
var getSymbols$1 = !nativeGetSymbols ? stubArray : function(object) {
|
1500
|
+
if (object == null) {
|
1501
|
+
return [];
|
1502
|
+
}
|
1503
|
+
object = Object(object);
|
1504
|
+
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
1505
|
+
return propertyIsEnumerable$1.call(object, symbol);
|
1506
|
+
});
|
1507
|
+
};
|
1508
|
+
|
1509
|
+
var _getSymbols = getSymbols$1;
|
1510
|
+
|
1511
|
+
/**
|
1512
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
1513
|
+
* or max array length checks.
|
1514
|
+
*
|
1515
|
+
* @private
|
1516
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
1517
|
+
* @param {Function} iteratee The function invoked per iteration.
|
1518
|
+
* @returns {Array} Returns the array of results.
|
1519
|
+
*/
|
1520
|
+
|
1521
|
+
function baseTimes$1(n, iteratee) {
|
1522
|
+
var index = -1,
|
1523
|
+
result = Array(n);
|
1524
|
+
|
1525
|
+
while (++index < n) {
|
1526
|
+
result[index] = iteratee(index);
|
1527
|
+
}
|
1528
|
+
return result;
|
1529
|
+
}
|
1530
|
+
|
1531
|
+
var _baseTimes = baseTimes$1;
|
1532
|
+
|
1533
|
+
/**
|
1534
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
1535
|
+
* and has a `typeof` result of "object".
|
1536
|
+
*
|
1537
|
+
* @static
|
1538
|
+
* @memberOf _
|
1539
|
+
* @since 4.0.0
|
1540
|
+
* @category Lang
|
1541
|
+
* @param {*} value The value to check.
|
1542
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
1543
|
+
* @example
|
1544
|
+
*
|
1545
|
+
* _.isObjectLike({});
|
1546
|
+
* // => true
|
1547
|
+
*
|
1548
|
+
* _.isObjectLike([1, 2, 3]);
|
1549
|
+
* // => true
|
1550
|
+
*
|
1551
|
+
* _.isObjectLike(_.noop);
|
1552
|
+
* // => false
|
1553
|
+
*
|
1554
|
+
* _.isObjectLike(null);
|
1555
|
+
* // => false
|
1556
|
+
*/
|
1557
|
+
|
1558
|
+
function isObjectLike$4(value) {
|
1559
|
+
return value != null && typeof value == 'object';
|
1560
|
+
}
|
1561
|
+
|
1562
|
+
var isObjectLike_1 = isObjectLike$4;
|
1563
|
+
|
1564
|
+
var baseGetTag$2 = _baseGetTag,
|
1565
|
+
isObjectLike$3 = isObjectLike_1;
|
1566
|
+
|
1567
|
+
/** `Object#toString` result references. */
|
1568
|
+
var argsTag$2 = '[object Arguments]';
|
1569
|
+
|
1570
|
+
/**
|
1571
|
+
* The base implementation of `_.isArguments`.
|
1572
|
+
*
|
1573
|
+
* @private
|
1574
|
+
* @param {*} value The value to check.
|
1575
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
1576
|
+
*/
|
1577
|
+
function baseIsArguments$1(value) {
|
1578
|
+
return isObjectLike$3(value) && baseGetTag$2(value) == argsTag$2;
|
1579
|
+
}
|
1580
|
+
|
1581
|
+
var _baseIsArguments = baseIsArguments$1;
|
1582
|
+
|
1583
|
+
var baseIsArguments = _baseIsArguments,
|
1584
|
+
isObjectLike$2 = isObjectLike_1;
|
1585
|
+
|
1586
|
+
/** Used for built-in method references. */
|
1587
|
+
var objectProto$5 = Object.prototype;
|
1588
|
+
|
1589
|
+
/** Used to check objects for own properties. */
|
1590
|
+
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
1591
|
+
|
1592
|
+
/** Built-in value references. */
|
1593
|
+
var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
|
1594
|
+
|
1595
|
+
/**
|
1596
|
+
* Checks if `value` is likely an `arguments` object.
|
1597
|
+
*
|
1598
|
+
* @static
|
1599
|
+
* @memberOf _
|
1600
|
+
* @since 0.1.0
|
1601
|
+
* @category Lang
|
1602
|
+
* @param {*} value The value to check.
|
1603
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
1604
|
+
* else `false`.
|
1605
|
+
* @example
|
1606
|
+
*
|
1607
|
+
* _.isArguments(function() { return arguments; }());
|
1608
|
+
* // => true
|
1609
|
+
*
|
1610
|
+
* _.isArguments([1, 2, 3]);
|
1611
|
+
* // => false
|
1612
|
+
*/
|
1613
|
+
var isArguments$1 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
1614
|
+
return isObjectLike$2(value) && hasOwnProperty$4.call(value, 'callee') &&
|
1615
|
+
!propertyIsEnumerable.call(value, 'callee');
|
1616
|
+
};
|
1617
|
+
|
1618
|
+
var isArguments_1 = isArguments$1;
|
1619
|
+
|
1620
|
+
var isBuffer$2 = {exports: {}};
|
1621
|
+
|
1622
|
+
/**
|
1623
|
+
* This method returns `false`.
|
1624
|
+
*
|
1625
|
+
* @static
|
1626
|
+
* @memberOf _
|
1627
|
+
* @since 4.13.0
|
1628
|
+
* @category Util
|
1629
|
+
* @returns {boolean} Returns `false`.
|
1630
|
+
* @example
|
1631
|
+
*
|
1632
|
+
* _.times(2, _.stubFalse);
|
1633
|
+
* // => [false, false]
|
1634
|
+
*/
|
1635
|
+
|
1636
|
+
function stubFalse() {
|
1637
|
+
return false;
|
1638
|
+
}
|
1639
|
+
|
1640
|
+
var stubFalse_1 = stubFalse;
|
1641
|
+
|
1642
|
+
(function (module, exports) {
|
1643
|
+
var root = _root,
|
1644
|
+
stubFalse = stubFalse_1;
|
1645
|
+
|
1646
|
+
/** Detect free variable `exports`. */
|
1647
|
+
var freeExports = exports && !exports.nodeType && exports;
|
1648
|
+
|
1649
|
+
/** Detect free variable `module`. */
|
1650
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
1651
|
+
|
1652
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
1653
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
1654
|
+
|
1655
|
+
/** Built-in value references. */
|
1656
|
+
var Buffer = moduleExports ? root.Buffer : undefined;
|
1657
|
+
|
1658
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
1659
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
1660
|
+
|
1661
|
+
/**
|
1662
|
+
* Checks if `value` is a buffer.
|
1663
|
+
*
|
1664
|
+
* @static
|
1665
|
+
* @memberOf _
|
1666
|
+
* @since 4.3.0
|
1667
|
+
* @category Lang
|
1668
|
+
* @param {*} value The value to check.
|
1669
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
1670
|
+
* @example
|
1671
|
+
*
|
1672
|
+
* _.isBuffer(new Buffer(2));
|
1673
|
+
* // => true
|
1674
|
+
*
|
1675
|
+
* _.isBuffer(new Uint8Array(2));
|
1676
|
+
* // => false
|
1677
|
+
*/
|
1678
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
1679
|
+
|
1680
|
+
module.exports = isBuffer;
|
1681
|
+
}(isBuffer$2, isBuffer$2.exports));
|
1682
|
+
|
1683
|
+
/** Used as references for various `Number` constants. */
|
1684
|
+
|
1685
|
+
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
1686
|
+
|
1687
|
+
/** Used to detect unsigned integer values. */
|
1688
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
1689
|
+
|
1690
|
+
/**
|
1691
|
+
* Checks if `value` is a valid array-like index.
|
1692
|
+
*
|
1693
|
+
* @private
|
1694
|
+
* @param {*} value The value to check.
|
1695
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
1696
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
1697
|
+
*/
|
1698
|
+
function isIndex$1(value, length) {
|
1699
|
+
var type = typeof value;
|
1700
|
+
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
1701
|
+
|
1702
|
+
return !!length &&
|
1703
|
+
(type == 'number' ||
|
1704
|
+
(type != 'symbol' && reIsUint.test(value))) &&
|
1705
|
+
(value > -1 && value % 1 == 0 && value < length);
|
1706
|
+
}
|
1707
|
+
|
1708
|
+
var _isIndex = isIndex$1;
|
1709
|
+
|
1710
|
+
/** Used as references for various `Number` constants. */
|
1711
|
+
|
1712
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
1713
|
+
|
1714
|
+
/**
|
1715
|
+
* Checks if `value` is a valid array-like length.
|
1716
|
+
*
|
1717
|
+
* **Note:** This method is loosely based on
|
1718
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
1719
|
+
*
|
1720
|
+
* @static
|
1721
|
+
* @memberOf _
|
1722
|
+
* @since 4.0.0
|
1723
|
+
* @category Lang
|
1724
|
+
* @param {*} value The value to check.
|
1725
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
1726
|
+
* @example
|
1727
|
+
*
|
1728
|
+
* _.isLength(3);
|
1729
|
+
* // => true
|
1730
|
+
*
|
1731
|
+
* _.isLength(Number.MIN_VALUE);
|
1732
|
+
* // => false
|
1733
|
+
*
|
1734
|
+
* _.isLength(Infinity);
|
1735
|
+
* // => false
|
1736
|
+
*
|
1737
|
+
* _.isLength('3');
|
1738
|
+
* // => false
|
1739
|
+
*/
|
1740
|
+
function isLength$2(value) {
|
1741
|
+
return typeof value == 'number' &&
|
1742
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
1743
|
+
}
|
1744
|
+
|
1745
|
+
var isLength_1 = isLength$2;
|
1746
|
+
|
1747
|
+
var baseGetTag$1 = _baseGetTag,
|
1748
|
+
isLength$1 = isLength_1,
|
1749
|
+
isObjectLike$1 = isObjectLike_1;
|
1750
|
+
|
1751
|
+
/** `Object#toString` result references. */
|
1752
|
+
var argsTag$1 = '[object Arguments]',
|
1753
|
+
arrayTag$1 = '[object Array]',
|
1754
|
+
boolTag = '[object Boolean]',
|
1755
|
+
dateTag = '[object Date]',
|
1756
|
+
errorTag = '[object Error]',
|
1757
|
+
funcTag = '[object Function]',
|
1758
|
+
mapTag$1 = '[object Map]',
|
1759
|
+
numberTag = '[object Number]',
|
1760
|
+
objectTag$2 = '[object Object]',
|
1761
|
+
regexpTag = '[object RegExp]',
|
1762
|
+
setTag$1 = '[object Set]',
|
1763
|
+
stringTag = '[object String]',
|
1764
|
+
weakMapTag$1 = '[object WeakMap]';
|
1765
|
+
|
1766
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
1767
|
+
dataViewTag$1 = '[object DataView]',
|
1768
|
+
float32Tag = '[object Float32Array]',
|
1769
|
+
float64Tag = '[object Float64Array]',
|
1770
|
+
int8Tag = '[object Int8Array]',
|
1771
|
+
int16Tag = '[object Int16Array]',
|
1772
|
+
int32Tag = '[object Int32Array]',
|
1773
|
+
uint8Tag = '[object Uint8Array]',
|
1774
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
1775
|
+
uint16Tag = '[object Uint16Array]',
|
1776
|
+
uint32Tag = '[object Uint32Array]';
|
1777
|
+
|
1778
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
1779
|
+
var typedArrayTags = {};
|
1780
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
1781
|
+
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
1782
|
+
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
1783
|
+
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
1784
|
+
typedArrayTags[uint32Tag] = true;
|
1785
|
+
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
|
1786
|
+
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
1787
|
+
typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] =
|
1788
|
+
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
1789
|
+
typedArrayTags[mapTag$1] = typedArrayTags[numberTag] =
|
1790
|
+
typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] =
|
1791
|
+
typedArrayTags[setTag$1] = typedArrayTags[stringTag] =
|
1792
|
+
typedArrayTags[weakMapTag$1] = false;
|
1793
|
+
|
1794
|
+
/**
|
1795
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
1796
|
+
*
|
1797
|
+
* @private
|
1798
|
+
* @param {*} value The value to check.
|
1799
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
1800
|
+
*/
|
1801
|
+
function baseIsTypedArray$1(value) {
|
1802
|
+
return isObjectLike$1(value) &&
|
1803
|
+
isLength$1(value.length) && !!typedArrayTags[baseGetTag$1(value)];
|
1804
|
+
}
|
1805
|
+
|
1806
|
+
var _baseIsTypedArray = baseIsTypedArray$1;
|
1807
|
+
|
1808
|
+
/**
|
1809
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
1810
|
+
*
|
1811
|
+
* @private
|
1812
|
+
* @param {Function} func The function to cap arguments for.
|
1813
|
+
* @returns {Function} Returns the new capped function.
|
1814
|
+
*/
|
1815
|
+
|
1816
|
+
function baseUnary$1(func) {
|
1817
|
+
return function(value) {
|
1818
|
+
return func(value);
|
1819
|
+
};
|
1820
|
+
}
|
1821
|
+
|
1822
|
+
var _baseUnary = baseUnary$1;
|
1823
|
+
|
1824
|
+
var _nodeUtil = {exports: {}};
|
1825
|
+
|
1826
|
+
(function (module, exports) {
|
1827
|
+
var freeGlobal = _freeGlobal;
|
1828
|
+
|
1829
|
+
/** Detect free variable `exports`. */
|
1830
|
+
var freeExports = exports && !exports.nodeType && exports;
|
1831
|
+
|
1832
|
+
/** Detect free variable `module`. */
|
1833
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
1834
|
+
|
1835
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
1836
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
1837
|
+
|
1838
|
+
/** Detect free variable `process` from Node.js. */
|
1839
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
1840
|
+
|
1841
|
+
/** Used to access faster Node.js helpers. */
|
1842
|
+
var nodeUtil = (function() {
|
1843
|
+
try {
|
1844
|
+
// Use `util.types` for Node.js 10+.
|
1845
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
1846
|
+
|
1847
|
+
if (types) {
|
1848
|
+
return types;
|
1849
|
+
}
|
1850
|
+
|
1851
|
+
// Legacy `process.binding('util')` for Node.js < 10.
|
1852
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
1853
|
+
} catch (e) {}
|
1854
|
+
}());
|
1855
|
+
|
1856
|
+
module.exports = nodeUtil;
|
1857
|
+
}(_nodeUtil, _nodeUtil.exports));
|
1858
|
+
|
1859
|
+
var baseIsTypedArray = _baseIsTypedArray,
|
1860
|
+
baseUnary = _baseUnary,
|
1861
|
+
nodeUtil = _nodeUtil.exports;
|
1862
|
+
|
1863
|
+
/* Node.js helper references. */
|
1864
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
1865
|
+
|
1866
|
+
/**
|
1867
|
+
* Checks if `value` is classified as a typed array.
|
1868
|
+
*
|
1869
|
+
* @static
|
1870
|
+
* @memberOf _
|
1871
|
+
* @since 3.0.0
|
1872
|
+
* @category Lang
|
1873
|
+
* @param {*} value The value to check.
|
1874
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
1875
|
+
* @example
|
1876
|
+
*
|
1877
|
+
* _.isTypedArray(new Uint8Array);
|
1878
|
+
* // => true
|
1879
|
+
*
|
1880
|
+
* _.isTypedArray([]);
|
1881
|
+
* // => false
|
1882
|
+
*/
|
1883
|
+
var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
1884
|
+
|
1885
|
+
var isTypedArray_1 = isTypedArray$2;
|
1886
|
+
|
1887
|
+
var baseTimes = _baseTimes,
|
1888
|
+
isArguments = isArguments_1,
|
1889
|
+
isArray$1 = isArray_1,
|
1890
|
+
isBuffer$1 = isBuffer$2.exports,
|
1891
|
+
isIndex = _isIndex,
|
1892
|
+
isTypedArray$1 = isTypedArray_1;
|
1893
|
+
|
1894
|
+
/** Used for built-in method references. */
|
1895
|
+
var objectProto$4 = Object.prototype;
|
1896
|
+
|
1897
|
+
/** Used to check objects for own properties. */
|
1898
|
+
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
1899
|
+
|
1900
|
+
/**
|
1901
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
1902
|
+
*
|
1903
|
+
* @private
|
1904
|
+
* @param {*} value The value to query.
|
1905
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
1906
|
+
* @returns {Array} Returns the array of property names.
|
1907
|
+
*/
|
1908
|
+
function arrayLikeKeys$1(value, inherited) {
|
1909
|
+
var isArr = isArray$1(value),
|
1910
|
+
isArg = !isArr && isArguments(value),
|
1911
|
+
isBuff = !isArr && !isArg && isBuffer$1(value),
|
1912
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray$1(value),
|
1913
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
1914
|
+
result = skipIndexes ? baseTimes(value.length, String) : [],
|
1915
|
+
length = result.length;
|
1916
|
+
|
1917
|
+
for (var key in value) {
|
1918
|
+
if ((inherited || hasOwnProperty$3.call(value, key)) &&
|
1919
|
+
!(skipIndexes && (
|
1920
|
+
// Safari 9 has enumerable `arguments.length` in strict mode.
|
1921
|
+
key == 'length' ||
|
1922
|
+
// Node.js 0.10 has enumerable non-index properties on buffers.
|
1923
|
+
(isBuff && (key == 'offset' || key == 'parent')) ||
|
1924
|
+
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
1925
|
+
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
1926
|
+
// Skip index properties.
|
1927
|
+
isIndex(key, length)
|
1928
|
+
))) {
|
1929
|
+
result.push(key);
|
1930
|
+
}
|
1931
|
+
}
|
1932
|
+
return result;
|
1933
|
+
}
|
1934
|
+
|
1935
|
+
var _arrayLikeKeys = arrayLikeKeys$1;
|
1936
|
+
|
1937
|
+
/** Used for built-in method references. */
|
1938
|
+
|
1939
|
+
var objectProto$3 = Object.prototype;
|
1940
|
+
|
1941
|
+
/**
|
1942
|
+
* Checks if `value` is likely a prototype object.
|
1943
|
+
*
|
1944
|
+
* @private
|
1945
|
+
* @param {*} value The value to check.
|
1946
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
1947
|
+
*/
|
1948
|
+
function isPrototype$1(value) {
|
1949
|
+
var Ctor = value && value.constructor,
|
1950
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
|
1951
|
+
|
1952
|
+
return value === proto;
|
1953
|
+
}
|
1954
|
+
|
1955
|
+
var _isPrototype = isPrototype$1;
|
1956
|
+
|
1957
|
+
/**
|
1958
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
1959
|
+
*
|
1960
|
+
* @private
|
1961
|
+
* @param {Function} func The function to wrap.
|
1962
|
+
* @param {Function} transform The argument transform.
|
1963
|
+
* @returns {Function} Returns the new function.
|
1964
|
+
*/
|
1965
|
+
|
1966
|
+
function overArg$1(func, transform) {
|
1967
|
+
return function(arg) {
|
1968
|
+
return func(transform(arg));
|
1969
|
+
};
|
1970
|
+
}
|
1971
|
+
|
1972
|
+
var _overArg = overArg$1;
|
1973
|
+
|
1974
|
+
var overArg = _overArg;
|
1975
|
+
|
1976
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
1977
|
+
var nativeKeys$1 = overArg(Object.keys, Object);
|
1978
|
+
|
1979
|
+
var _nativeKeys = nativeKeys$1;
|
1980
|
+
|
1981
|
+
var isPrototype = _isPrototype,
|
1982
|
+
nativeKeys = _nativeKeys;
|
1983
|
+
|
1984
|
+
/** Used for built-in method references. */
|
1985
|
+
var objectProto$2 = Object.prototype;
|
1986
|
+
|
1987
|
+
/** Used to check objects for own properties. */
|
1988
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
1989
|
+
|
1990
|
+
/**
|
1991
|
+
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
1992
|
+
*
|
1993
|
+
* @private
|
1994
|
+
* @param {Object} object The object to query.
|
1995
|
+
* @returns {Array} Returns the array of property names.
|
1996
|
+
*/
|
1997
|
+
function baseKeys$1(object) {
|
1998
|
+
if (!isPrototype(object)) {
|
1999
|
+
return nativeKeys(object);
|
2000
|
+
}
|
2001
|
+
var result = [];
|
2002
|
+
for (var key in Object(object)) {
|
2003
|
+
if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
|
2004
|
+
result.push(key);
|
2005
|
+
}
|
2006
|
+
}
|
2007
|
+
return result;
|
2008
|
+
}
|
2009
|
+
|
2010
|
+
var _baseKeys = baseKeys$1;
|
2011
|
+
|
2012
|
+
var isFunction = isFunction_1,
|
2013
|
+
isLength = isLength_1;
|
2014
|
+
|
2015
|
+
/**
|
2016
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
2017
|
+
* not a function and has a `value.length` that's an integer greater than or
|
2018
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
2019
|
+
*
|
2020
|
+
* @static
|
2021
|
+
* @memberOf _
|
2022
|
+
* @since 4.0.0
|
2023
|
+
* @category Lang
|
2024
|
+
* @param {*} value The value to check.
|
2025
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
2026
|
+
* @example
|
2027
|
+
*
|
2028
|
+
* _.isArrayLike([1, 2, 3]);
|
2029
|
+
* // => true
|
2030
|
+
*
|
2031
|
+
* _.isArrayLike(document.body.children);
|
2032
|
+
* // => true
|
2033
|
+
*
|
2034
|
+
* _.isArrayLike('abc');
|
2035
|
+
* // => true
|
2036
|
+
*
|
2037
|
+
* _.isArrayLike(_.noop);
|
2038
|
+
* // => false
|
2039
|
+
*/
|
2040
|
+
function isArrayLike$1(value) {
|
2041
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
2042
|
+
}
|
2043
|
+
|
2044
|
+
var isArrayLike_1 = isArrayLike$1;
|
2045
|
+
|
2046
|
+
var arrayLikeKeys = _arrayLikeKeys,
|
2047
|
+
baseKeys = _baseKeys,
|
2048
|
+
isArrayLike = isArrayLike_1;
|
2049
|
+
|
2050
|
+
/**
|
2051
|
+
* Creates an array of the own enumerable property names of `object`.
|
2052
|
+
*
|
2053
|
+
* **Note:** Non-object values are coerced to objects. See the
|
2054
|
+
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
2055
|
+
* for more details.
|
2056
|
+
*
|
2057
|
+
* @static
|
2058
|
+
* @since 0.1.0
|
2059
|
+
* @memberOf _
|
2060
|
+
* @category Object
|
2061
|
+
* @param {Object} object The object to query.
|
2062
|
+
* @returns {Array} Returns the array of property names.
|
2063
|
+
* @example
|
2064
|
+
*
|
2065
|
+
* function Foo() {
|
2066
|
+
* this.a = 1;
|
2067
|
+
* this.b = 2;
|
2068
|
+
* }
|
2069
|
+
*
|
2070
|
+
* Foo.prototype.c = 3;
|
2071
|
+
*
|
2072
|
+
* _.keys(new Foo);
|
2073
|
+
* // => ['a', 'b'] (iteration order is not guaranteed)
|
2074
|
+
*
|
2075
|
+
* _.keys('hi');
|
2076
|
+
* // => ['0', '1']
|
2077
|
+
*/
|
2078
|
+
function keys$1(object) {
|
2079
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
2080
|
+
}
|
2081
|
+
|
2082
|
+
var keys_1 = keys$1;
|
2083
|
+
|
2084
|
+
var baseGetAllKeys = _baseGetAllKeys,
|
2085
|
+
getSymbols = _getSymbols,
|
2086
|
+
keys = keys_1;
|
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$1(object) {
|
2096
|
+
return baseGetAllKeys(object, keys, getSymbols);
|
2097
|
+
}
|
2098
|
+
|
2099
|
+
var _getAllKeys = getAllKeys$1;
|
2100
|
+
|
2101
|
+
var getAllKeys = _getAllKeys;
|
2102
|
+
|
2103
|
+
/** Used to compose bitmasks for value comparisons. */
|
2104
|
+
var COMPARE_PARTIAL_FLAG$1 = 1;
|
2105
|
+
|
2106
|
+
/** Used for built-in method references. */
|
2107
|
+
var objectProto$1 = Object.prototype;
|
2108
|
+
|
2109
|
+
/** Used to check objects for own properties. */
|
2110
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
2111
|
+
|
2112
|
+
/**
|
2113
|
+
* A specialized version of `baseIsEqualDeep` for objects with support for
|
2114
|
+
* partial deep comparisons.
|
2115
|
+
*
|
2116
|
+
* @private
|
2117
|
+
* @param {Object} object The object to compare.
|
2118
|
+
* @param {Object} other The other object to compare.
|
2119
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
2120
|
+
* @param {Function} customizer The function to customize comparisons.
|
2121
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
2122
|
+
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
2123
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
2124
|
+
*/
|
2125
|
+
function equalObjects$1(object, other, bitmask, customizer, equalFunc, stack) {
|
2126
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
|
2127
|
+
objProps = getAllKeys(object),
|
2128
|
+
objLength = objProps.length,
|
2129
|
+
othProps = getAllKeys(other),
|
2130
|
+
othLength = othProps.length;
|
2131
|
+
|
2132
|
+
if (objLength != othLength && !isPartial) {
|
2133
|
+
return false;
|
2134
|
+
}
|
2135
|
+
var index = objLength;
|
2136
|
+
while (index--) {
|
2137
|
+
var key = objProps[index];
|
2138
|
+
if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
|
2139
|
+
return false;
|
2140
|
+
}
|
2141
|
+
}
|
2142
|
+
// Check that cyclic values are equal.
|
2143
|
+
var objStacked = stack.get(object);
|
2144
|
+
var othStacked = stack.get(other);
|
2145
|
+
if (objStacked && othStacked) {
|
2146
|
+
return objStacked == other && othStacked == object;
|
2147
|
+
}
|
2148
|
+
var result = true;
|
2149
|
+
stack.set(object, other);
|
2150
|
+
stack.set(other, object);
|
2151
|
+
|
2152
|
+
var skipCtor = isPartial;
|
2153
|
+
while (++index < objLength) {
|
2154
|
+
key = objProps[index];
|
2155
|
+
var objValue = object[key],
|
2156
|
+
othValue = other[key];
|
2157
|
+
|
2158
|
+
if (customizer) {
|
2159
|
+
var compared = isPartial
|
2160
|
+
? customizer(othValue, objValue, key, other, object, stack)
|
2161
|
+
: customizer(objValue, othValue, key, object, other, stack);
|
2162
|
+
}
|
2163
|
+
// Recursively compare objects (susceptible to call stack limits).
|
2164
|
+
if (!(compared === undefined
|
2165
|
+
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
|
2166
|
+
: compared
|
2167
|
+
)) {
|
2168
|
+
result = false;
|
2169
|
+
break;
|
2170
|
+
}
|
2171
|
+
skipCtor || (skipCtor = key == 'constructor');
|
2172
|
+
}
|
2173
|
+
if (result && !skipCtor) {
|
2174
|
+
var objCtor = object.constructor,
|
2175
|
+
othCtor = other.constructor;
|
2176
|
+
|
2177
|
+
// Non `Object` object instances with different constructors are not equal.
|
2178
|
+
if (objCtor != othCtor &&
|
2179
|
+
('constructor' in object && 'constructor' in other) &&
|
2180
|
+
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
|
2181
|
+
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
|
2182
|
+
result = false;
|
2183
|
+
}
|
2184
|
+
}
|
2185
|
+
stack['delete'](object);
|
2186
|
+
stack['delete'](other);
|
2187
|
+
return result;
|
2188
|
+
}
|
2189
|
+
|
2190
|
+
var _equalObjects = equalObjects$1;
|
2191
|
+
|
2192
|
+
var getNative$3 = _getNative,
|
2193
|
+
root$3 = _root;
|
2194
|
+
|
2195
|
+
/* Built-in method references that are verified to be native. */
|
2196
|
+
var DataView$1 = getNative$3(root$3, 'DataView');
|
2197
|
+
|
2198
|
+
var _DataView = DataView$1;
|
2199
|
+
|
2200
|
+
var getNative$2 = _getNative,
|
2201
|
+
root$2 = _root;
|
2202
|
+
|
2203
|
+
/* Built-in method references that are verified to be native. */
|
2204
|
+
var Promise$2 = getNative$2(root$2, 'Promise');
|
2205
|
+
|
2206
|
+
var _Promise = Promise$2;
|
2207
|
+
|
2208
|
+
var getNative$1 = _getNative,
|
2209
|
+
root$1 = _root;
|
2210
|
+
|
2211
|
+
/* Built-in method references that are verified to be native. */
|
2212
|
+
var Set$1 = getNative$1(root$1, 'Set');
|
2213
|
+
|
2214
|
+
var _Set = Set$1;
|
2215
|
+
|
2216
|
+
var getNative = _getNative,
|
2217
|
+
root = _root;
|
2218
|
+
|
2219
|
+
/* Built-in method references that are verified to be native. */
|
2220
|
+
var WeakMap$1 = getNative(root, 'WeakMap');
|
2221
|
+
|
2222
|
+
var _WeakMap = WeakMap$1;
|
2223
|
+
|
2224
|
+
var DataView = _DataView,
|
2225
|
+
Map$1 = _Map,
|
2226
|
+
Promise$1 = _Promise,
|
2227
|
+
Set = _Set,
|
2228
|
+
WeakMap = _WeakMap,
|
2229
|
+
baseGetTag = _baseGetTag,
|
2230
|
+
toSource = _toSource;
|
2231
|
+
|
2232
|
+
/** `Object#toString` result references. */
|
2233
|
+
var mapTag = '[object Map]',
|
2234
|
+
objectTag$1 = '[object Object]',
|
2235
|
+
promiseTag = '[object Promise]',
|
2236
|
+
setTag = '[object Set]',
|
2237
|
+
weakMapTag = '[object WeakMap]';
|
2238
|
+
|
2239
|
+
var dataViewTag = '[object DataView]';
|
2240
|
+
|
2241
|
+
/** Used to detect maps, sets, and weakmaps. */
|
2242
|
+
var dataViewCtorString = toSource(DataView),
|
2243
|
+
mapCtorString = toSource(Map$1),
|
2244
|
+
promiseCtorString = toSource(Promise$1),
|
2245
|
+
setCtorString = toSource(Set),
|
2246
|
+
weakMapCtorString = toSource(WeakMap);
|
2247
|
+
|
2248
|
+
/**
|
2249
|
+
* Gets the `toStringTag` of `value`.
|
2250
|
+
*
|
2251
|
+
* @private
|
2252
|
+
* @param {*} value The value to query.
|
2253
|
+
* @returns {string} Returns the `toStringTag`.
|
2254
|
+
*/
|
2255
|
+
var getTag$1 = baseGetTag;
|
2256
|
+
|
2257
|
+
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
2258
|
+
if ((DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
2259
|
+
(Map$1 && getTag$1(new Map$1) != mapTag) ||
|
2260
|
+
(Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag) ||
|
2261
|
+
(Set && getTag$1(new Set) != setTag) ||
|
2262
|
+
(WeakMap && getTag$1(new WeakMap) != weakMapTag)) {
|
2263
|
+
getTag$1 = function(value) {
|
2264
|
+
var result = baseGetTag(value),
|
2265
|
+
Ctor = result == objectTag$1 ? value.constructor : undefined,
|
2266
|
+
ctorString = Ctor ? toSource(Ctor) : '';
|
2267
|
+
|
2268
|
+
if (ctorString) {
|
2269
|
+
switch (ctorString) {
|
2270
|
+
case dataViewCtorString: return dataViewTag;
|
2271
|
+
case mapCtorString: return mapTag;
|
2272
|
+
case promiseCtorString: return promiseTag;
|
2273
|
+
case setCtorString: return setTag;
|
2274
|
+
case weakMapCtorString: return weakMapTag;
|
2275
|
+
}
|
2276
|
+
}
|
2277
|
+
return result;
|
2278
|
+
};
|
2279
|
+
}
|
2280
|
+
|
2281
|
+
var _getTag = getTag$1;
|
2282
|
+
|
2283
|
+
var Stack = _Stack,
|
2284
|
+
equalArrays = _equalArrays,
|
2285
|
+
equalByTag = _equalByTag,
|
2286
|
+
equalObjects = _equalObjects,
|
2287
|
+
getTag = _getTag,
|
2288
|
+
isArray = isArray_1,
|
2289
|
+
isBuffer = isBuffer$2.exports,
|
2290
|
+
isTypedArray = isTypedArray_1;
|
2291
|
+
|
2292
|
+
/** Used to compose bitmasks for value comparisons. */
|
2293
|
+
var COMPARE_PARTIAL_FLAG = 1;
|
2294
|
+
|
2295
|
+
/** `Object#toString` result references. */
|
2296
|
+
var argsTag = '[object Arguments]',
|
2297
|
+
arrayTag = '[object Array]',
|
2298
|
+
objectTag = '[object Object]';
|
2299
|
+
|
2300
|
+
/** Used for built-in method references. */
|
2301
|
+
var objectProto = Object.prototype;
|
2302
|
+
|
2303
|
+
/** Used to check objects for own properties. */
|
2304
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
2305
|
+
|
2306
|
+
/**
|
2307
|
+
* A specialized version of `baseIsEqual` for arrays and objects which performs
|
2308
|
+
* deep comparisons and tracks traversed objects enabling objects with circular
|
2309
|
+
* references to be compared.
|
2310
|
+
*
|
2311
|
+
* @private
|
2312
|
+
* @param {Object} object The object to compare.
|
2313
|
+
* @param {Object} other The other object to compare.
|
2314
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
2315
|
+
* @param {Function} customizer The function to customize comparisons.
|
2316
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
2317
|
+
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
2318
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
2319
|
+
*/
|
2320
|
+
function baseIsEqualDeep$1(object, other, bitmask, customizer, equalFunc, stack) {
|
2321
|
+
var objIsArr = isArray(object),
|
2322
|
+
othIsArr = isArray(other),
|
2323
|
+
objTag = objIsArr ? arrayTag : getTag(object),
|
2324
|
+
othTag = othIsArr ? arrayTag : getTag(other);
|
2325
|
+
|
2326
|
+
objTag = objTag == argsTag ? objectTag : objTag;
|
2327
|
+
othTag = othTag == argsTag ? objectTag : othTag;
|
2328
|
+
|
2329
|
+
var objIsObj = objTag == objectTag,
|
2330
|
+
othIsObj = othTag == objectTag,
|
2331
|
+
isSameTag = objTag == othTag;
|
2332
|
+
|
2333
|
+
if (isSameTag && isBuffer(object)) {
|
2334
|
+
if (!isBuffer(other)) {
|
2335
|
+
return false;
|
2336
|
+
}
|
2337
|
+
objIsArr = true;
|
2338
|
+
objIsObj = false;
|
2339
|
+
}
|
2340
|
+
if (isSameTag && !objIsObj) {
|
2341
|
+
stack || (stack = new Stack);
|
2342
|
+
return (objIsArr || isTypedArray(object))
|
2343
|
+
? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
2344
|
+
: equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
2345
|
+
}
|
2346
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
2347
|
+
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
2348
|
+
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
2349
|
+
|
2350
|
+
if (objIsWrapped || othIsWrapped) {
|
2351
|
+
var objUnwrapped = objIsWrapped ? object.value() : object,
|
2352
|
+
othUnwrapped = othIsWrapped ? other.value() : other;
|
2353
|
+
|
2354
|
+
stack || (stack = new Stack);
|
2355
|
+
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
2356
|
+
}
|
2357
|
+
}
|
2358
|
+
if (!isSameTag) {
|
2359
|
+
return false;
|
2360
|
+
}
|
2361
|
+
stack || (stack = new Stack);
|
2362
|
+
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
2363
|
+
}
|
2364
|
+
|
2365
|
+
var _baseIsEqualDeep = baseIsEqualDeep$1;
|
2366
|
+
|
2367
|
+
var baseIsEqualDeep = _baseIsEqualDeep,
|
2368
|
+
isObjectLike = isObjectLike_1;
|
2369
|
+
|
2370
|
+
/**
|
2371
|
+
* The base implementation of `_.isEqual` which supports partial comparisons
|
2372
|
+
* and tracks traversed objects.
|
2373
|
+
*
|
2374
|
+
* @private
|
2375
|
+
* @param {*} value The value to compare.
|
2376
|
+
* @param {*} other The other value to compare.
|
2377
|
+
* @param {boolean} bitmask The bitmask flags.
|
2378
|
+
* 1 - Unordered comparison
|
2379
|
+
* 2 - Partial comparison
|
2380
|
+
* @param {Function} [customizer] The function to customize comparisons.
|
2381
|
+
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
|
2382
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
2383
|
+
*/
|
2384
|
+
function baseIsEqual$1(value, other, bitmask, customizer, stack) {
|
2385
|
+
if (value === other) {
|
2386
|
+
return true;
|
2387
|
+
}
|
2388
|
+
if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
|
2389
|
+
return value !== value && other !== other;
|
2390
|
+
}
|
2391
|
+
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual$1, stack);
|
2392
|
+
}
|
2393
|
+
|
2394
|
+
var _baseIsEqual = baseIsEqual$1;
|
2395
|
+
|
2396
|
+
var baseIsEqual = _baseIsEqual;
|
2397
|
+
|
2398
|
+
/**
|
2399
|
+
* Performs a deep comparison between two values to determine if they are
|
2400
|
+
* equivalent.
|
2401
|
+
*
|
2402
|
+
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
2403
|
+
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
2404
|
+
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
2405
|
+
* by their own, not inherited, enumerable properties. Functions and DOM
|
2406
|
+
* nodes are compared by strict equality, i.e. `===`.
|
2407
|
+
*
|
2408
|
+
* @static
|
2409
|
+
* @memberOf _
|
2410
|
+
* @since 0.1.0
|
2411
|
+
* @category Lang
|
2412
|
+
* @param {*} value The value to compare.
|
2413
|
+
* @param {*} other The other value to compare.
|
2414
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
2415
|
+
* @example
|
2416
|
+
*
|
2417
|
+
* var object = { 'a': 1 };
|
2418
|
+
* var other = { 'a': 1 };
|
2419
|
+
*
|
2420
|
+
* _.isEqual(object, other);
|
2421
|
+
* // => true
|
2422
|
+
*
|
2423
|
+
* object === other;
|
2424
|
+
* // => false
|
2425
|
+
*/
|
2426
|
+
function isEqual(value, other) {
|
2427
|
+
return baseIsEqual(value, other);
|
2428
|
+
}
|
2429
|
+
|
2430
|
+
var isEqual_1 = isEqual;
|
2431
|
+
|
2432
|
+
var AxiosCancel = /** @class */ (function () {
|
2433
|
+
function AxiosCancel() {
|
2434
|
+
// private axiosCancelToken = new AxiosCancelToken();
|
2435
|
+
this.pendingRequests = new Map();
|
2436
|
+
}
|
2437
|
+
/**
|
2438
|
+
* 获取请求参数唯一key值
|
2439
|
+
*/
|
2440
|
+
AxiosCancel.prototype.getKey = function (config) {
|
2441
|
+
return [config.url, config.params, config.data]
|
2442
|
+
.filter(function (item) { return item; })
|
2443
|
+
.map(function (item) { return JSON.stringify(item); })
|
2444
|
+
.join('-');
|
2445
|
+
};
|
2446
|
+
/**
|
2447
|
+
* @description 发起请求之前,拦截重复请求
|
2448
|
+
*/
|
2449
|
+
AxiosCancel.prototype.pendingRequestCancel = function (config) {
|
2450
|
+
var key = this.getKey(config);
|
2451
|
+
var cancelTokenObj = axios.CancelToken.source();
|
2452
|
+
// 将token挂载到当前接口的请求头里面
|
2453
|
+
config.cancelToken = cancelTokenObj.token;
|
2454
|
+
if (this.pendingRequests.has(key)) {
|
2455
|
+
this.pendingRequests.get(key).cancel('拦截重复请求');
|
2456
|
+
this.pendingRequests.delete(key);
|
2457
|
+
}
|
2458
|
+
this.pendingRequests.set(key, {
|
2459
|
+
cancel: cancelTokenObj.cancel,
|
2460
|
+
});
|
2461
|
+
};
|
2462
|
+
/**
|
2463
|
+
* @description 请求完成之后, 清除pendingRequest
|
2464
|
+
*/
|
2465
|
+
AxiosCancel.prototype.clearPendingRequest = function (reponse) {
|
2466
|
+
var key = this.getKey(reponse.config);
|
2467
|
+
this.pendingRequests.delete(key);
|
2468
|
+
};
|
2469
|
+
return AxiosCancel;
|
2470
|
+
}());
|
2471
|
+
var axiosCancel = new AxiosCancel();
|
2472
|
+
|
2473
|
+
var timeoutNum = 60000;
|
2474
|
+
var isRefreshing = true; // 是否需要刷新
|
2475
|
+
var subscribers = []; // 缓存需要帮助请求的接口
|
2476
|
+
var requestTokenEndTime = 0; // token调用结束时间
|
2477
|
+
var reqTokenTimeInterval = 1000; // token调用最小间隔,如果超过这个数 那么就跳转到登录去
|
2478
|
+
var isMessage = false; // 超时弹框
|
2479
|
+
var isNotFound = false; // 404弹框
|
2480
|
+
var isOffSite = false; // 501异地登录
|
2481
|
+
var isExpiration = false; // 401登录过期
|
2482
|
+
var catchPromiseObj = []; // 缓存当前宏任务下的缓存
|
2483
|
+
var __isTimeoutMessage = false; // 是否需要默认展示超时弹框
|
2484
|
+
var isFirstSet = false; // 首次初始化
|
2485
|
+
// 'Basic em1kbXM6em1kbXNfc2VjcmV0' 新的auth
|
2486
|
+
// Basic c3dvcmQ6c3dvcmRfc2VjcmV0 旧的auth
|
2487
|
+
var OLD_AUTHORIZATION = 'Basic c3dvcmQ6c3dvcmRfc2VjcmV0';
|
2488
|
+
var NEW_AUTHORIZATION = 'Basic em1kbXM6em1kbXNfc2VjcmV0';
|
2489
|
+
var Authorization = OLD_AUTHORIZATION;
|
2490
|
+
// 用于存储目前状态为pending的请求标识信息 2023-05-15
|
2491
|
+
var pendingRequest = [];
|
2492
|
+
function loginRequest(params, InnerAuthorization) {
|
2493
|
+
return request({
|
2494
|
+
method: 'POST',
|
2495
|
+
url: '/api/zmdms-auth/oauth/token',
|
2496
|
+
baseURL: '',
|
2497
|
+
headers: {
|
2498
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
2499
|
+
'Tenant-Id': '000000',
|
2500
|
+
Authorization: InnerAuthorization ? InnerAuthorization : Authorization,
|
2501
|
+
'User-Type': 'web',
|
2502
|
+
},
|
2503
|
+
params: params,
|
2504
|
+
});
|
2505
|
+
}
|
2506
|
+
function checkStatus(response, jumpCallback, otherOptions) {
|
2507
|
+
var InnerAuthorization = (otherOptions || {}).InnerAuthorization;
|
2508
|
+
if ((response === null || response === void 0 ? void 0 : response.status) === 401) {
|
2509
|
+
if (isRefreshing) {
|
2510
|
+
if (Date.now() - requestTokenEndTime > reqTokenTimeInterval) {
|
2511
|
+
refreshTokenRequst(jumpCallback, InnerAuthorization);
|
2512
|
+
}
|
2513
|
+
else {
|
2514
|
+
message.info("\u5237\u65B0token\u906D\u5230\u9891\u7E41\u8C03\u7528\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u67E5\u770B\u662F\u5426\u63A5\u53E3\u6743\u9650\u51FA\u73B0\u95EE\u9898\uFF0C\u53EF\u80FD\u662F" + (response === null || response === void 0 ? void 0 : response.config.url) + "\u63A5\u53E3\u51FA\u73B0\u95EE\u9898", 5);
|
2515
|
+
requestTokenEndTime = 0;
|
2516
|
+
}
|
2517
|
+
}
|
2518
|
+
isRefreshing = false;
|
2519
|
+
// 注释调 帮助用户发送请求逻辑
|
2520
|
+
// 将失败请求放入promise数组里面
|
2521
|
+
// const retryOriginalRequest = new Promise((resolve) => {
|
2522
|
+
// // 如果重复的请求 不放在数组里面
|
2523
|
+
// if (
|
2524
|
+
// !repeatResponse.find((item) =>
|
2525
|
+
// isEqual(item, {
|
2526
|
+
// url: response?.config.url,
|
2527
|
+
// params: response?.config.params,
|
2528
|
+
// })
|
2529
|
+
// )
|
2530
|
+
// ) {
|
2531
|
+
// repeatResponse.push({
|
2532
|
+
// url: response?.config.url,
|
2533
|
+
// params: response?.config.params,
|
2534
|
+
// });
|
2535
|
+
// addSubscriber(() => {
|
2536
|
+
// resolve(
|
2537
|
+
// request({
|
2538
|
+
// url: response?.config.url,
|
2539
|
+
// params: response?.config.params,
|
2540
|
+
// })
|
2541
|
+
// );
|
2542
|
+
// });
|
2543
|
+
// }
|
2544
|
+
// });
|
2545
|
+
// return retryOriginalRequest;
|
2546
|
+
}
|
2547
|
+
}
|
2548
|
+
function refreshTokenRequst(jumpCallback, Authorization) {
|
2549
|
+
loginRequest({
|
2550
|
+
tenantId: '000000',
|
2551
|
+
grant_type: 'refresh_token',
|
2552
|
+
scope: 'all',
|
2553
|
+
refresh_token: getRefreshToken(),
|
2554
|
+
}, Authorization)
|
2555
|
+
.then(function (response) {
|
2556
|
+
var data = response.data, status = response.status;
|
2557
|
+
if (status === 200) {
|
2558
|
+
requestTokenEndTime = Date.now();
|
2559
|
+
// 刷新成功 重置token 重置refresh-token
|
2560
|
+
setToken(data === null || data === void 0 ? void 0 : data.access_token);
|
2561
|
+
setRefreshToken(data === null || data === void 0 ? void 0 : data.refresh_token);
|
2562
|
+
onAccessTokenFetched();
|
2563
|
+
isRefreshing = true;
|
2564
|
+
}
|
2565
|
+
else {
|
2566
|
+
requestTokenEndTime = 0;
|
2567
|
+
if (!isExpiration) {
|
2568
|
+
isExpiration = true;
|
2569
|
+
removeToken();
|
2570
|
+
removeRefreshToken();
|
2571
|
+
if (jumpCallback) {
|
2572
|
+
jumpCallback(401);
|
2573
|
+
}
|
2574
|
+
else {
|
2575
|
+
message.info("\u767B\u5F55\u8FC7\u671F\uFF01", 3.5, function () {
|
2576
|
+
isExpiration = false;
|
2577
|
+
});
|
2578
|
+
window.location.href = '/login';
|
2579
|
+
}
|
2580
|
+
}
|
2581
|
+
}
|
2582
|
+
})
|
2583
|
+
.catch(function (error) {
|
2584
|
+
requestTokenEndTime = 0;
|
2585
|
+
if (!isExpiration) {
|
2586
|
+
isExpiration = true;
|
2587
|
+
if (jumpCallback) {
|
2588
|
+
jumpCallback(401);
|
2589
|
+
}
|
2590
|
+
else {
|
2591
|
+
message.info("\u767B\u5F55\u8FC7\u671F\uFF01", 3.5, function () {
|
2592
|
+
isExpiration = false;
|
2593
|
+
});
|
2594
|
+
window.location.href = '/login';
|
2595
|
+
}
|
2596
|
+
}
|
2597
|
+
});
|
2598
|
+
}
|
2599
|
+
// 将失败的token存储到promise数组里面
|
2600
|
+
function onAccessTokenFetched() {
|
2601
|
+
subscribers.forEach(function (callback) {
|
2602
|
+
callback && callback();
|
2603
|
+
});
|
2604
|
+
subscribers = [];
|
2605
|
+
}
|
2606
|
+
function setInterceptorsResponse(jumpCallback, otherOptions) {
|
2607
|
+
// 拦截器,拦截响应头信息
|
2608
|
+
var isRefreshToken = (otherOptions || {}).isRefreshToken;
|
2609
|
+
axios.interceptors.response.use(function (response) {
|
2610
|
+
var _a, _b, _c;
|
2611
|
+
// catchPromiseObj = [];
|
2612
|
+
axiosCancel.clearPendingRequest(response);
|
2613
|
+
if ((_a = response.config) === null || _a === void 0 ? void 0 : _a.noInterceptorsResponse) {
|
2614
|
+
return Promise.resolve(response);
|
2615
|
+
}
|
2616
|
+
if (response.status === 200) {
|
2617
|
+
if ((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.code) {
|
2618
|
+
if (((_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.code) === 200) {
|
2619
|
+
return Promise.resolve(response);
|
2620
|
+
}
|
2621
|
+
else {
|
2622
|
+
return Promise.reject({ response: response });
|
2623
|
+
}
|
2624
|
+
}
|
2625
|
+
else {
|
2626
|
+
return Promise.resolve(response);
|
2627
|
+
}
|
2628
|
+
}
|
2629
|
+
else if (response.status === 201) {
|
2630
|
+
return Promise.resolve(response);
|
2631
|
+
}
|
2632
|
+
else {
|
2633
|
+
return Promise.reject(response);
|
2634
|
+
}
|
2635
|
+
}, function (error) {
|
2636
|
+
var _a, _b, _c, _d, _e;
|
2637
|
+
// catchPromiseObj = [];
|
2638
|
+
console.error(error);
|
2639
|
+
var errRes = error === null || error === void 0 ? void 0 : error.response;
|
2640
|
+
/** 如果接口出错了,那么清理掉这个错误的接口 */
|
2641
|
+
var item = catchPromiseObj.findIndex(function (item) {
|
2642
|
+
return isEqual_1({
|
2643
|
+
url: item.url,
|
2644
|
+
params: item.params,
|
2645
|
+
}, {
|
2646
|
+
url: error === null || error === void 0 ? void 0 : error.config.url,
|
2647
|
+
params: error === null || error === void 0 ? void 0 : error.config.params,
|
2648
|
+
});
|
2649
|
+
});
|
2650
|
+
if (item !== -1) {
|
2651
|
+
catchPromiseObj.splice(item, 1);
|
2652
|
+
}
|
2653
|
+
console.log(error === null || error === void 0 ? void 0 : error.config, catchPromiseObj);
|
2654
|
+
/** 如果接口出错了,那么清理掉这个错误的接口 */
|
2655
|
+
// 超时异常统一处理,超时的异常没有response值,只能通过toString处理
|
2656
|
+
if (!errRes && error.toString().indexOf(timeoutNum + "ms") !== -1) {
|
2657
|
+
if (!isMessage) {
|
2658
|
+
if (((_b = (_a = error === null || error === void 0 ? void 0 : error.config) === null || _a === void 0 ? void 0 : _a.method) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === 'POST' &&
|
2659
|
+
__isTimeoutMessage) {
|
2660
|
+
isMessage = true;
|
2661
|
+
Modal.confirm({
|
2662
|
+
title: "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF0C\u8BF7\u53BB\u5217\u8868\u786E\u8BA4\u6570\u636E\u662F\u5426\u63D2\u5165\u6210\u529F\uFF0C\u8BF7\u52FF\u91CD\u590D\u63D0\u4EA4\uFF01\n\u63A5\u53E3\u5730\u5740:" + ((_c = error === null || error === void 0 ? void 0 : error.config) === null || _c === void 0 ? void 0 : _c.url) + "\n\u8BF7\u6C42\u65B9\u5F0F:" + ((_d = error === null || error === void 0 ? void 0 : error.config) === null || _d === void 0 ? void 0 : _d.method) + "\n\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4:" + ((_e = error === null || error === void 0 ? void 0 : error.config) === null || _e === void 0 ? void 0 : _e.timeout),
|
2663
|
+
okCancel: false,
|
2664
|
+
onOk: function () {
|
2665
|
+
isMessage = false;
|
2666
|
+
},
|
2667
|
+
});
|
2668
|
+
}
|
2669
|
+
}
|
2670
|
+
return Promise.reject(error);
|
2671
|
+
}
|
2672
|
+
// 接口404处理
|
2673
|
+
if ((errRes === null || errRes === void 0 ? void 0 : errRes.status) === 404) {
|
2674
|
+
if (!isNotFound) {
|
2675
|
+
isNotFound = true;
|
2676
|
+
message.info("\u63A5\u53E3: " + errRes.config.url + " \u672A\u627E\u5230\uFF01", 3.5, function () {
|
2677
|
+
isNotFound = false;
|
2678
|
+
});
|
2679
|
+
}
|
2680
|
+
return Promise.reject(error);
|
2681
|
+
}
|
2682
|
+
// 接口501处理
|
2683
|
+
if ((errRes === null || errRes === void 0 ? void 0 : errRes.status) === 501) {
|
2684
|
+
if (!isOffSite) {
|
2685
|
+
isOffSite = true;
|
2686
|
+
removeToken();
|
2687
|
+
removeRefreshToken();
|
2688
|
+
if (jumpCallback) {
|
2689
|
+
jumpCallback(errRes === null || errRes === void 0 ? void 0 : errRes.status);
|
2690
|
+
}
|
2691
|
+
else {
|
2692
|
+
message.info("\u4F60\u7684\u8D26\u53F7\u5DF2\u5728\u5176\u4ED6\u5730\u65B9\u767B\u5F55\uFF01", 3.5, function () {
|
2693
|
+
isOffSite = false;
|
2694
|
+
});
|
2695
|
+
window.location.href = '/login';
|
2696
|
+
}
|
2697
|
+
}
|
2698
|
+
return Promise.reject(error);
|
2699
|
+
}
|
2700
|
+
// 接口401处理,401状态后不需要重新刷新token,直接退出登录
|
2701
|
+
if ((errRes === null || errRes === void 0 ? void 0 : errRes.status) === 401 && !isRefreshToken) {
|
2702
|
+
if (!isExpiration) {
|
2703
|
+
isExpiration = true;
|
2704
|
+
removeToken();
|
2705
|
+
removeRefreshToken();
|
2706
|
+
if (jumpCallback) {
|
2707
|
+
jumpCallback(errRes === null || errRes === void 0 ? void 0 : errRes.status);
|
2708
|
+
}
|
2709
|
+
else {
|
2710
|
+
message.info("\u767B\u5F55\u8FC7\u671F\uFF01", 3.5, function () {
|
2711
|
+
isExpiration = false;
|
2712
|
+
});
|
2713
|
+
window.location.href = '/login';
|
2714
|
+
}
|
2715
|
+
}
|
2716
|
+
return Promise.reject(error);
|
2717
|
+
}
|
2718
|
+
// 其余的异常,全部交给业务自己处理
|
2719
|
+
checkStatus(errRes, jumpCallback, otherOptions);
|
2720
|
+
return Promise.reject(error);
|
2721
|
+
});
|
2722
|
+
}
|
2723
|
+
function setInterceptorsRequest() {
|
2724
|
+
// 拦截器,拦截响应头信息
|
2725
|
+
axios.interceptors.request.use(function (config) {
|
2726
|
+
var _a, _b, _c;
|
2727
|
+
if (config.isCancelRepeat) {
|
2728
|
+
axiosCancel.pendingRequestCancel(config);
|
2729
|
+
}
|
2730
|
+
// 如果需要清除未完成的请求 2023-05-15
|
2731
|
+
if (config.isCancelNoCompleteRequest &&
|
2732
|
+
!config.cancelToken &&
|
2733
|
+
((_a = config.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== 'POST' &&
|
2734
|
+
!((_c = (_b = config.url) === null || _b === void 0 ? void 0 : _b.includes) === null || _c === void 0 ? void 0 : _c.call(_b, 'zmdms-resource'))) {
|
2735
|
+
var cancelTokenObj = axios.CancelToken.source();
|
2736
|
+
config.cancelToken = cancelTokenObj.token;
|
2737
|
+
pendingRequest.push(cancelTokenObj.cancel);
|
2738
|
+
}
|
2739
|
+
return config;
|
2740
|
+
});
|
2741
|
+
}
|
2742
|
+
function transformObj(obj) {
|
2743
|
+
if (typeof obj === 'undefined') {
|
2744
|
+
return null;
|
2745
|
+
}
|
2746
|
+
if (typeof obj === 'object' && obj !== null) {
|
2747
|
+
if (Array.isArray(obj)) {
|
2748
|
+
return obj.map(function (item) { return transformObj(item); });
|
2749
|
+
}
|
2750
|
+
else {
|
2751
|
+
if (obj instanceof File) {
|
2752
|
+
return obj;
|
2753
|
+
}
|
2754
|
+
if (obj instanceof FormData) {
|
2755
|
+
return obj;
|
2756
|
+
}
|
2757
|
+
var newObj = {};
|
2758
|
+
for (var key in obj) {
|
2759
|
+
if (obj.hasOwnProperty(key)) {
|
2760
|
+
newObj[key] = transformObj(obj[key]);
|
2761
|
+
}
|
2762
|
+
}
|
2763
|
+
return newObj;
|
2764
|
+
}
|
2765
|
+
}
|
2766
|
+
return obj;
|
2767
|
+
}
|
2768
|
+
function request(myOptions, jumpCallback, otherOptions) {
|
2769
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
2770
|
+
var InnerAuthorization = (otherOptions || {}).InnerAuthorization;
|
2771
|
+
if (!isFirstSet) {
|
2772
|
+
setInterceptorsRequest();
|
2773
|
+
setInterceptorsResponse(jumpCallback, otherOptions);
|
2774
|
+
isFirstSet = true;
|
2775
|
+
}
|
2776
|
+
var encryptionType = myOptions.encryptionType, isTimeoutMessage = myOptions.isTimeoutMessage, isForceRequest = myOptions.isForceRequest, _k = myOptions.noCatchUrl, noCatchUrl = _k === void 0 ? [] : _k, isCatch = myOptions.isCatch, mustCatch = myOptions.mustCatch, options = __rest(myOptions, ["encryptionType", "isTimeoutMessage", "isForceRequest", "noCatchUrl", "isCatch", "mustCatch"]);
|
2777
|
+
timeoutNum =
|
2778
|
+
typeof myOptions.timeout === 'number' ? myOptions.timeout : timeoutNum;
|
2779
|
+
__isTimeoutMessage = isTimeoutMessage;
|
2780
|
+
// 获取token
|
2781
|
+
var token = getToken();
|
2782
|
+
// 默认配置,请求头,超时时间,基础url
|
2783
|
+
var defaultOptions = {
|
2784
|
+
timeout: timeoutNum,
|
2785
|
+
// baseURL: ZT_API_BASEURL,
|
2786
|
+
headers: {
|
2787
|
+
'Zmdms-Auth': "bearer " + token,
|
2788
|
+
'Tenant-Id': '000000',
|
2789
|
+
Authorization: InnerAuthorization ? InnerAuthorization : Authorization,
|
2790
|
+
},
|
2791
|
+
};
|
2792
|
+
if ((_a = options.baseURL) === null || _a === void 0 ? void 0 : _a.endsWith('/')) {
|
2793
|
+
if ((_b = options.url) === null || _b === void 0 ? void 0 : _b.startsWith('/')) {
|
2794
|
+
options.url = (_c = options.url) === null || _c === void 0 ? void 0 : _c.slice(1);
|
2795
|
+
}
|
2796
|
+
}
|
2797
|
+
else if (!((_d = options.url) === null || _d === void 0 ? void 0 : _d.startsWith('/'))) {
|
2798
|
+
options.url = "/" + options.url;
|
2799
|
+
}
|
2800
|
+
// 遍历params,将undefined的值,变为null值或空字符串(undefined会被JSON.stringify忽略)
|
2801
|
+
if (options.data) {
|
2802
|
+
options.data = transformObj(options.data);
|
2803
|
+
}
|
2804
|
+
if (options.params) {
|
2805
|
+
options.params = transformObj(options.params);
|
2806
|
+
}
|
2807
|
+
// 将传入配置与默认配置混合
|
2808
|
+
var newOptions = __assign(__assign(__assign({}, defaultOptions), options), { headers: __assign(__assign({}, defaultOptions.headers), options.headers) });
|
2809
|
+
// 特殊请求处理
|
2810
|
+
if (((_e = newOptions.method) === null || _e === void 0 ? void 0 : _e.toUpperCase()) === 'POST' ||
|
2811
|
+
((_f = newOptions.method) === null || _f === void 0 ? void 0 : _f.toUpperCase()) === 'PUT' ||
|
2812
|
+
((_g = newOptions.method) === null || _g === void 0 ? void 0 : _g.toUpperCase()) === 'PATCH') {
|
2813
|
+
if (newOptions.isFormData) {
|
2814
|
+
// 表单提交操作
|
2815
|
+
var formData = new FormData();
|
2816
|
+
var dataObj = newOptions.data || {};
|
2817
|
+
var dataKey = Object.keys(dataObj);
|
2818
|
+
var dataVal = Object.values(dataObj);
|
2819
|
+
for (var i = 0; i < dataKey.length; i++) {
|
2820
|
+
if (dataVal[i]) {
|
2821
|
+
formData.append(dataKey[i], dataVal[i]);
|
2822
|
+
}
|
2823
|
+
}
|
2824
|
+
newOptions.headers = __assign(__assign({}, newOptions.headers), { 'Content-Type': 'multipart/form-data' });
|
2825
|
+
newOptions.data = formData;
|
2826
|
+
}
|
2827
|
+
else {
|
2828
|
+
newOptions.headers = __assign({ 'Content-Type': 'application/json' }, newOptions.headers);
|
2829
|
+
}
|
2830
|
+
}
|
2831
|
+
// 将参数进行aes加密
|
2832
|
+
if (newOptions.data) {
|
2833
|
+
if (encryptionType === true || encryptionType === 'aes') {
|
2834
|
+
newOptions.data = crypto.encrypt(JSON.stringify(newOptions.data));
|
2835
|
+
}
|
2836
|
+
if (encryptionType === 'des') {
|
2837
|
+
newOptions.data = crypto.encrypt_des(JSON.stringify(newOptions.data));
|
2838
|
+
}
|
2839
|
+
}
|
2840
|
+
if (newOptions.params) {
|
2841
|
+
if (encryptionType === true || encryptionType === 'aes') {
|
2842
|
+
newOptions.params = {
|
2843
|
+
data: crypto.encrypt(JSON.stringify(newOptions.params)),
|
2844
|
+
};
|
2845
|
+
}
|
2846
|
+
if (encryptionType === 'des') {
|
2847
|
+
newOptions.params = {
|
2848
|
+
data: crypto.encrypt_des(JSON.stringify(newOptions.params)),
|
2849
|
+
};
|
2850
|
+
}
|
2851
|
+
}
|
2852
|
+
// 缓存本次宏任务下的GET请求,并且不是以/page结尾的列表分页接口
|
2853
|
+
// 并且不是强制请求,强制请求需要
|
2854
|
+
if ((((_h = newOptions.method) === null || _h === void 0 ? void 0 : _h.toUpperCase()) === 'GET' &&
|
2855
|
+
!((_j = newOptions.url) === null || _j === void 0 ? void 0 : _j.endsWith('/page')) &&
|
2856
|
+
!noCatchUrl.find(function (item) { var _a; return (_a = newOptions.url) === null || _a === void 0 ? void 0 : _a.endsWith(item); }) &&
|
2857
|
+
isCatch) ||
|
2858
|
+
mustCatch) {
|
2859
|
+
// 能不能找到,url与参数都一样得数据
|
2860
|
+
var index = catchPromiseObj.findIndex(function (item) {
|
2861
|
+
return isEqual_1({
|
2862
|
+
url: item.url,
|
2863
|
+
params: item.params,
|
2864
|
+
}, {
|
2865
|
+
url: newOptions.url,
|
2866
|
+
params: newOptions.params,
|
2867
|
+
});
|
2868
|
+
});
|
2869
|
+
// 如果是强制请求,并且之前有缓存 那么删除掉之前的缓存
|
2870
|
+
if (isForceRequest && index !== -1) {
|
2871
|
+
catchPromiseObj.splice(index, 1);
|
2872
|
+
index = -1;
|
2873
|
+
}
|
2874
|
+
if (index !== -1) {
|
2875
|
+
var item = catchPromiseObj[index];
|
2876
|
+
return item === null || item === void 0 ? void 0 : item.promiseObj;
|
2877
|
+
}
|
2878
|
+
else {
|
2879
|
+
var result = axios(newOptions);
|
2880
|
+
if (catchPromiseObj.length > 40) {
|
2881
|
+
catchPromiseObj.shift();
|
2882
|
+
}
|
2883
|
+
catchPromiseObj.push({
|
2884
|
+
url: newOptions.url,
|
2885
|
+
params: newOptions.params,
|
2886
|
+
promiseObj: result,
|
2887
|
+
});
|
2888
|
+
return result;
|
2889
|
+
}
|
2890
|
+
}
|
2891
|
+
return axios(newOptions);
|
2892
|
+
}
|
2893
|
+
// 清除未完成的请求 2023-05-15
|
2894
|
+
function clearNoCompleteRequest() {
|
2895
|
+
pendingRequest.forEach(function (cancel, index) {
|
2896
|
+
cancel && cancel();
|
2897
|
+
});
|
2898
|
+
pendingRequest = [];
|
2899
|
+
}
|
2900
|
+
function clearCatch() {
|
2901
|
+
catchPromiseObj = [];
|
2902
|
+
}
|
2903
|
+
|
2904
|
+
var request$1 = /*#__PURE__*/Object.freeze({
|
2905
|
+
__proto__: null,
|
2906
|
+
OLD_AUTHORIZATION: OLD_AUTHORIZATION,
|
2907
|
+
NEW_AUTHORIZATION: NEW_AUTHORIZATION,
|
2908
|
+
'default': request,
|
2909
|
+
clearNoCompleteRequest: clearNoCompleteRequest,
|
2910
|
+
clearCatch: clearCatch
|
2911
|
+
});
|
2912
|
+
|
2913
|
+
export { NEW_AUTHORIZATION as N, OLD_AUTHORIZATION as O, request as a, clearCatch as b, clearNoCompleteRequest as c, request$1 as r };
|