ut2 1.2.2 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -35
- package/dist/ut2.js +433 -245
- package/dist/ut2.js.map +1 -1
- package/dist/ut2.min.js +1 -1
- package/dist/ut2.min.js.map +1 -1
- package/es/index.js +30 -29
- package/es/internals/compare.js +27 -6
- package/es/internals/getTag.js +7 -9
- package/es/internals/helpers.js +3 -2
- package/es/internals/native.js +17 -1
- package/es/isArguments.js +1 -3
- package/es/isArrayBuffer.js +1 -3
- package/es/isEqual.js +185 -0
- package/es/isSafeInteger.js +1 -3
- package/es/isTypedArray.js +1 -15
- package/lib/index.js +60 -58
- package/lib/internals/compare.js +27 -6
- package/lib/internals/getTag.js +6 -8
- package/lib/internals/helpers.js +3 -2
- package/lib/internals/native.js +16 -0
- package/lib/isArguments.js +1 -3
- package/lib/isArrayBuffer.js +1 -3
- package/lib/isEqual.js +187 -0
- package/lib/isSafeInteger.js +1 -3
- package/lib/isTypedArray.js +1 -15
- package/package.json +1 -1
- package/types/difference.d.ts +1 -1
- package/types/eq.d.ts +1 -1
- package/types/index.d.ts +42 -41
- package/types/internals/native.d.ts +16 -0
- package/types/intersection.d.ts +1 -1
- package/types/isArguments.d.ts +1 -1
- package/types/isArray.d.ts +1 -1
- package/types/isArrayBuffer.d.ts +1 -1
- package/types/isArrayLike.d.ts +1 -1
- package/types/isArrayLikeObject.d.ts +1 -1
- package/types/isBlob.d.ts +1 -1
- package/types/isBoolean.d.ts +1 -1
- package/types/isBuffer.d.ts +1 -1
- package/types/isDataView.d.ts +1 -1
- package/types/isDate.d.ts +1 -1
- package/types/isElement.d.ts +1 -1
- package/types/isEmpty.d.ts +1 -1
- package/types/isEqual.d.ts +44 -0
- package/types/isError.d.ts +1 -1
- package/types/isFinite.d.ts +1 -1
- package/types/isFunction.d.ts +1 -1
- package/types/isInteger.d.ts +1 -1
- package/types/isLength.d.ts +1 -1
- package/types/isMap.d.ts +1 -1
- package/types/isNaN.d.ts +1 -1
- package/types/isNil.d.ts +1 -1
- package/types/isNull.d.ts +1 -1
- package/types/isNumber.d.ts +1 -1
- package/types/isObject.d.ts +1 -1
- package/types/isObjectLike.d.ts +1 -1
- package/types/isPlainObject.d.ts +1 -1
- package/types/isPromiseLike.d.ts +1 -1
- package/types/isRegExp.d.ts +1 -1
- package/types/isSafeInteger.d.ts +1 -1
- package/types/isSet.d.ts +1 -1
- package/types/isString.d.ts +1 -1
- package/types/isSymbol.d.ts +1 -1
- package/types/isTypedArray.d.ts +1 -1
- package/types/isUndefined.d.ts +1 -1
- package/types/isWeakMap.d.ts +1 -1
- package/types/isWeakSet.d.ts +1 -1
- package/types/union.d.ts +1 -1
- package/types/uniq.d.ts +1 -1
- package/types/xor.d.ts +1 -1
package/dist/ut2.js
CHANGED
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
19
19
|
var functionToString = Function.prototype.toString;
|
|
20
20
|
var objectCtorString = functionToString.call(Object);
|
|
21
|
+
var symbolProto = Symbol ? Symbol.prototype : undefined;
|
|
22
|
+
var symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
|
23
|
+
symbolProto ? symbolProto.toString : undefined;
|
|
24
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
25
|
+
var arrayProto = Array.prototype;
|
|
26
|
+
var arrSlice = Array.prototype.slice;
|
|
21
27
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
22
28
|
var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;
|
|
23
29
|
var MAX_ARRAY_LENGTH = 4294967295;
|
|
@@ -37,6 +43,16 @@
|
|
|
37
43
|
}
|
|
38
44
|
return '';
|
|
39
45
|
}
|
|
46
|
+
var numberTag = '[object Number]';
|
|
47
|
+
var booleanTag = '[object Boolean]';
|
|
48
|
+
var stringTag = '[object String]';
|
|
49
|
+
var dateTag = '[object Date]';
|
|
50
|
+
var regExpTag = '[object RegExp]';
|
|
51
|
+
var symbolTag = '[object Symbol]';
|
|
52
|
+
var errorTag = '[object Error]';
|
|
53
|
+
var arrayBufferTag = '[object ArrayBuffer]';
|
|
54
|
+
var argumentsTag = '[object Arguments]';
|
|
55
|
+
var arrayTag = '[object Array]';
|
|
40
56
|
var objectTag = '[object Object]';
|
|
41
57
|
var dataViewTag = '[object DataView]';
|
|
42
58
|
var mapTag = '[object Map]';
|
|
@@ -61,11 +77,11 @@
|
|
|
61
77
|
}
|
|
62
78
|
|
|
63
79
|
function getRawTag(value) {
|
|
64
|
-
var isOwn = hasOwnProperty.call(value,
|
|
65
|
-
var tag = value[
|
|
80
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag);
|
|
81
|
+
var tag = value[symToStringTag];
|
|
66
82
|
var unmasked = false;
|
|
67
83
|
try {
|
|
68
|
-
value[
|
|
84
|
+
value[symToStringTag] = undefined;
|
|
69
85
|
unmasked = true;
|
|
70
86
|
}
|
|
71
87
|
catch (e) {
|
|
@@ -73,18 +89,16 @@
|
|
|
73
89
|
var result = objectToString.call(value);
|
|
74
90
|
if (unmasked) {
|
|
75
91
|
if (isOwn) {
|
|
76
|
-
value[
|
|
92
|
+
value[symToStringTag] = tag;
|
|
77
93
|
}
|
|
78
94
|
else {
|
|
79
|
-
delete value[
|
|
95
|
+
delete value[symToStringTag];
|
|
80
96
|
}
|
|
81
97
|
}
|
|
82
98
|
return result;
|
|
83
99
|
}
|
|
84
100
|
function _getTag(value) {
|
|
85
|
-
return
|
|
86
|
-
? getRawTag(value)
|
|
87
|
-
: objectToString.call(value);
|
|
101
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString.call(value);
|
|
88
102
|
}
|
|
89
103
|
var getTag = _getTag;
|
|
90
104
|
if ((dataViewExisted && objectToString.call(new DataView(new ArrayBuffer(1))) !== dataViewTag) ||
|
|
@@ -266,8 +280,8 @@
|
|
|
266
280
|
var numberIsInteger = Number.isInteger;
|
|
267
281
|
var numberIsSafeInteger = Number.isSafeInteger;
|
|
268
282
|
var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
269
|
-
var arrayAt =
|
|
270
|
-
var VERSION = "1.
|
|
283
|
+
var arrayAt = arrayProto.at;
|
|
284
|
+
var VERSION = "1.3.1";
|
|
271
285
|
|
|
272
286
|
function isFunction(value) {
|
|
273
287
|
if (!isObject(value)) {
|
|
@@ -460,26 +474,63 @@
|
|
|
460
474
|
return value;
|
|
461
475
|
}
|
|
462
476
|
|
|
477
|
+
function baseToString(value) {
|
|
478
|
+
if (typeof value === 'string') {
|
|
479
|
+
return value;
|
|
480
|
+
}
|
|
481
|
+
if (isArray(value)) {
|
|
482
|
+
return "".concat(value.map(baseToString));
|
|
483
|
+
}
|
|
484
|
+
if (isSymbol(value)) {
|
|
485
|
+
return value.toString();
|
|
486
|
+
}
|
|
487
|
+
var result = '' + value;
|
|
488
|
+
return result == '0' && 1 / value === -Infinity ? '-0' : result;
|
|
489
|
+
}
|
|
490
|
+
function toString(value) {
|
|
491
|
+
return value == null ? '' : baseToString(value);
|
|
492
|
+
}
|
|
493
|
+
|
|
463
494
|
function compareAsc(value, other) {
|
|
464
|
-
|
|
495
|
+
var valueIsSymbol = isSymbol(value);
|
|
496
|
+
var otherIsSymbol = isSymbol(other);
|
|
497
|
+
if (valueIsSymbol && otherIsSymbol) {
|
|
465
498
|
return 0;
|
|
466
499
|
}
|
|
467
|
-
if (
|
|
500
|
+
if (valueIsSymbol) {
|
|
501
|
+
return 1;
|
|
502
|
+
}
|
|
503
|
+
if (otherIsSymbol) {
|
|
504
|
+
return -1;
|
|
505
|
+
}
|
|
506
|
+
var valStr = toString(value);
|
|
507
|
+
var othStr = toString(other);
|
|
508
|
+
if (valStr > othStr) {
|
|
468
509
|
return 1;
|
|
469
510
|
}
|
|
470
|
-
|
|
511
|
+
if (valStr < othStr) {
|
|
471
512
|
return -1;
|
|
472
513
|
}
|
|
473
514
|
return 0;
|
|
474
515
|
}
|
|
475
516
|
function compareDesc(value, other) {
|
|
476
|
-
|
|
517
|
+
var valueIsSymbol = isSymbol(value);
|
|
518
|
+
var otherIsSymbol = isSymbol(other);
|
|
519
|
+
if (valueIsSymbol && otherIsSymbol) {
|
|
477
520
|
return 0;
|
|
478
521
|
}
|
|
479
|
-
if (
|
|
522
|
+
if (valueIsSymbol) {
|
|
480
523
|
return -1;
|
|
481
524
|
}
|
|
482
|
-
|
|
525
|
+
if (otherIsSymbol) {
|
|
526
|
+
return 1;
|
|
527
|
+
}
|
|
528
|
+
var valStr = toString(value);
|
|
529
|
+
var othStr = toString(other);
|
|
530
|
+
if (valStr > othStr) {
|
|
531
|
+
return -1;
|
|
532
|
+
}
|
|
533
|
+
if (valStr < othStr) {
|
|
483
534
|
return 1;
|
|
484
535
|
}
|
|
485
536
|
return 0;
|
|
@@ -701,25 +752,377 @@
|
|
|
701
752
|
return baseDebounce(func, wait, immediate, true);
|
|
702
753
|
}
|
|
703
754
|
|
|
704
|
-
function
|
|
705
|
-
|
|
755
|
+
function isArguments(value) {
|
|
756
|
+
if (supportedArgumentsType) {
|
|
757
|
+
return isObjectLike(value) && isType(value, argType);
|
|
758
|
+
}
|
|
759
|
+
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
|
|
706
760
|
}
|
|
707
761
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
762
|
+
var freeExports = typeof exports === 'object' && exports && !exports.nodeType && exports;
|
|
763
|
+
var freeModule = freeExports && typeof module === 'object' && module && !module.nodeType && module;
|
|
764
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
765
|
+
var freeProcess = moduleExports && root.process;
|
|
766
|
+
var nodeUtil = (function () {
|
|
767
|
+
try {
|
|
768
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
769
|
+
if (types) {
|
|
770
|
+
return types;
|
|
771
|
+
}
|
|
772
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
711
773
|
}
|
|
712
|
-
|
|
713
|
-
return "".concat(value.map(baseToString));
|
|
774
|
+
catch (e) {
|
|
714
775
|
}
|
|
715
|
-
|
|
716
|
-
|
|
776
|
+
})();
|
|
777
|
+
var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer;
|
|
778
|
+
var nodeIsDate = nodeUtil && nodeUtil.isDate;
|
|
779
|
+
var nodeIsMap = nodeUtil && nodeUtil.isMap;
|
|
780
|
+
var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
|
|
781
|
+
var nodeIsSet = nodeUtil && nodeUtil.isSet;
|
|
782
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
783
|
+
|
|
784
|
+
function isArrayBuffer(value) {
|
|
785
|
+
return nodeIsArrayBuffer ? nodeIsArrayBuffer(value) : isObjectLike(value) && isType(value, 'ArrayBuffer');
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
function isBlob(value) {
|
|
789
|
+
return (blobExisted && value instanceof Blob) || isType(value, ['Blob', 'File']);
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
function isBoolean(value) {
|
|
793
|
+
return value === true || value === false || isType(value, 'Boolean');
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
function isBuffer(value) {
|
|
797
|
+
if (typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function') {
|
|
798
|
+
return Buffer.isBuffer(value);
|
|
717
799
|
}
|
|
718
|
-
|
|
719
|
-
return result == '0' && 1 / value === -Infinity ? '-0' : result;
|
|
800
|
+
return false;
|
|
720
801
|
}
|
|
721
|
-
|
|
722
|
-
|
|
802
|
+
|
|
803
|
+
function isDataView(value) {
|
|
804
|
+
return isType(value, 'DataView');
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
function isDate(value) {
|
|
808
|
+
return nodeIsDate ? nodeIsDate(value) : isObjectLike(value) && isType(value, 'Date');
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
function isPlainObject(value) {
|
|
812
|
+
if (!isObjectLike(value) || !isType(value, 'Object')) {
|
|
813
|
+
return false;
|
|
814
|
+
}
|
|
815
|
+
var proto = Object.getPrototypeOf(Object(value));
|
|
816
|
+
if (proto === null) {
|
|
817
|
+
return true;
|
|
818
|
+
}
|
|
819
|
+
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
820
|
+
return typeof Ctor === 'function' && Ctor instanceof Ctor && functionToString.call(Ctor) === objectCtorString;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
function isElement(value) {
|
|
824
|
+
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
function isPrototype(value) {
|
|
828
|
+
if (typeof value !== 'object') {
|
|
829
|
+
return false;
|
|
830
|
+
}
|
|
831
|
+
var Ctor = value.constructor;
|
|
832
|
+
var proto = typeof Ctor === 'function' ? Ctor.prototype : objectProto;
|
|
833
|
+
return value === proto;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
function keys(value) {
|
|
837
|
+
if (!isPrototype(value)) {
|
|
838
|
+
return Object.keys(value);
|
|
839
|
+
}
|
|
840
|
+
var result = [];
|
|
841
|
+
for (var key in Object(value)) {
|
|
842
|
+
if (hasOwnProperty.call(value, key) && key !== 'constructor') {
|
|
843
|
+
result.push(key);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return result;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
function isMap(value) {
|
|
850
|
+
return nodeIsMap ? nodeIsMap(value) : isObjectLike(value) && isType(value, 'Map');
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
function isSet(value) {
|
|
854
|
+
return nodeIsSet ? nodeIsSet(value) : isObjectLike(value) && isType(value, 'Set');
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
function isEmpty(value) {
|
|
858
|
+
if (value == null) {
|
|
859
|
+
return true;
|
|
860
|
+
}
|
|
861
|
+
if (isMap(value) || isSet(value)) {
|
|
862
|
+
return !value.size;
|
|
863
|
+
}
|
|
864
|
+
if (isObjectLike(value)) {
|
|
865
|
+
return !keys(value).length;
|
|
866
|
+
}
|
|
867
|
+
if (isArrayLike(value)) {
|
|
868
|
+
return !value.length;
|
|
869
|
+
}
|
|
870
|
+
return true;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
function getSymbols(object) {
|
|
874
|
+
if (!objectGetOwnPropertySymbols || object === null) {
|
|
875
|
+
return [];
|
|
876
|
+
}
|
|
877
|
+
return objectGetOwnPropertySymbols(object).filter(function (item) {
|
|
878
|
+
return propertyIsEnumerable.call(object, item);
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
function allKeys(object) {
|
|
883
|
+
if (!isObject(object)) {
|
|
884
|
+
return [];
|
|
885
|
+
}
|
|
886
|
+
return Object.keys(object).concat(getSymbols(object));
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
function isNil(value) {
|
|
890
|
+
return value == null;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
function isTypedArray(value) {
|
|
894
|
+
if (nodeIsTypedArray) {
|
|
895
|
+
return nodeIsTypedArray(value);
|
|
896
|
+
}
|
|
897
|
+
return isObjectLike(value) && isLength(value.length) && isType(value, ['Float32Array', 'Float64Array', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'BigInt64Array', 'BigUint64Array']);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
function mapToArray(map) {
|
|
901
|
+
var result = [];
|
|
902
|
+
map.forEach(function (value, key) {
|
|
903
|
+
result.push([key, value]);
|
|
904
|
+
});
|
|
905
|
+
return orderBy(result, [0, 1]);
|
|
906
|
+
}
|
|
907
|
+
function setToArray(set) {
|
|
908
|
+
var result = [];
|
|
909
|
+
set.forEach(function (value) {
|
|
910
|
+
result.push(value);
|
|
911
|
+
});
|
|
912
|
+
return orderBy(result);
|
|
913
|
+
}
|
|
914
|
+
function argToArray(arg) {
|
|
915
|
+
return arrSlice.call(arg);
|
|
916
|
+
}
|
|
917
|
+
function toBufferView(bufferSource) {
|
|
918
|
+
return new Uint8Array(bufferSource.buffer || bufferSource, bufferSource.byteOffset || 0, bufferSource.byteLength);
|
|
919
|
+
}
|
|
920
|
+
function isDomNode(obj) {
|
|
921
|
+
return isObjectLike(obj) && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string' && typeof obj.isEqualNode === 'function';
|
|
922
|
+
}
|
|
923
|
+
function isEqualDeep(value, other, customizer, strictCheck, valueStack, otherStack) {
|
|
924
|
+
if (eq(value, other, strictCheck)) {
|
|
925
|
+
return true;
|
|
926
|
+
}
|
|
927
|
+
var valType = typeof value;
|
|
928
|
+
var othType = typeof other;
|
|
929
|
+
if (strictCheck && valType !== othType) {
|
|
930
|
+
return false;
|
|
931
|
+
}
|
|
932
|
+
if (isNil(value) || isNil(other) || (valType !== 'object' && othType !== 'object')) {
|
|
933
|
+
return false;
|
|
934
|
+
}
|
|
935
|
+
var tag = getTag$1(value);
|
|
936
|
+
if (tag !== getTag$1(other)) {
|
|
937
|
+
return false;
|
|
938
|
+
}
|
|
939
|
+
var convert;
|
|
940
|
+
switch (tag) {
|
|
941
|
+
case numberTag:
|
|
942
|
+
return eq(+value, +other, strictCheck);
|
|
943
|
+
case booleanTag:
|
|
944
|
+
case dateTag:
|
|
945
|
+
return strictCheck ? +value === +other : eq(+value, +other);
|
|
946
|
+
case stringTag:
|
|
947
|
+
case regExpTag:
|
|
948
|
+
return '' + value === '' + other;
|
|
949
|
+
case symbolTag:
|
|
950
|
+
return symbolValueOf ? symbolValueOf.call(value) === symbolValueOf.call(other) : false;
|
|
951
|
+
case errorTag:
|
|
952
|
+
return value.name == other.name && value.message == other.message;
|
|
953
|
+
case dataViewTag:
|
|
954
|
+
case arrayBufferTag:
|
|
955
|
+
if (value.byteLength !== other.byteLength || (value.byteOffset && value.byteOffset !== other.byteOffset)) {
|
|
956
|
+
return false;
|
|
957
|
+
}
|
|
958
|
+
convert = toBufferView;
|
|
959
|
+
break;
|
|
960
|
+
case mapTag:
|
|
961
|
+
convert = mapToArray;
|
|
962
|
+
break;
|
|
963
|
+
case setTag:
|
|
964
|
+
convert = setToArray;
|
|
965
|
+
break;
|
|
966
|
+
case argumentsTag:
|
|
967
|
+
convert = argToArray;
|
|
968
|
+
break;
|
|
969
|
+
}
|
|
970
|
+
if (convert) {
|
|
971
|
+
return isEqualDeep(convert(value), convert(other), customizer, strictCheck, valueStack, otherStack);
|
|
972
|
+
}
|
|
973
|
+
if (isDomNode(value) && isDomNode(other)) {
|
|
974
|
+
return value.isEqualNode(other);
|
|
975
|
+
}
|
|
976
|
+
var areArrays = tag === arrayTag;
|
|
977
|
+
if (!areArrays && isTypedArray(value)) {
|
|
978
|
+
if (value.byteLength !== other.byteLength) {
|
|
979
|
+
return false;
|
|
980
|
+
}
|
|
981
|
+
if (value.buffer === other.buffer && value.byteOffset === other.byteOffset) {
|
|
982
|
+
return true;
|
|
983
|
+
}
|
|
984
|
+
areArrays = true;
|
|
985
|
+
}
|
|
986
|
+
if (isBuffer(value)) {
|
|
987
|
+
if (!isBuffer(other)) {
|
|
988
|
+
return false;
|
|
989
|
+
}
|
|
990
|
+
areArrays = true;
|
|
991
|
+
}
|
|
992
|
+
valueStack = valueStack || [];
|
|
993
|
+
otherStack = otherStack || [];
|
|
994
|
+
var length = valueStack.length;
|
|
995
|
+
while (length--) {
|
|
996
|
+
if (valueStack[length] === value) {
|
|
997
|
+
return otherStack[length] === other;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
valueStack.push(value);
|
|
1001
|
+
otherStack.push(other);
|
|
1002
|
+
var result = true;
|
|
1003
|
+
var hasCustomizer = typeof customizer === 'function';
|
|
1004
|
+
if (areArrays) {
|
|
1005
|
+
length = value.length;
|
|
1006
|
+
if (length !== other.length) {
|
|
1007
|
+
return false;
|
|
1008
|
+
}
|
|
1009
|
+
while (length--) {
|
|
1010
|
+
if (hasCustomizer) {
|
|
1011
|
+
var compared = customizer(value[length], other[length], length, value, other, valueStack, otherStack);
|
|
1012
|
+
if (compared !== undefined) {
|
|
1013
|
+
result = !!compared;
|
|
1014
|
+
break;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
if (!isEqualDeep(value[length], other[length], customizer, strictCheck, valueStack, otherStack)) {
|
|
1018
|
+
result = false;
|
|
1019
|
+
break;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
else if (tag === objectTag) {
|
|
1024
|
+
var keys = allKeys(value);
|
|
1025
|
+
length = keys.length;
|
|
1026
|
+
if (allKeys(other).length !== length) {
|
|
1027
|
+
return false;
|
|
1028
|
+
}
|
|
1029
|
+
var skipCtor = false;
|
|
1030
|
+
while (length--) {
|
|
1031
|
+
var key = keys[length];
|
|
1032
|
+
if (hasCustomizer) {
|
|
1033
|
+
var compared = customizer(value[key], other[key], key, value, other, valueStack, otherStack);
|
|
1034
|
+
if (compared !== undefined) {
|
|
1035
|
+
result = !!compared;
|
|
1036
|
+
break;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
if (!(hasOwnProperty.call(other, key) && isEqualDeep(value[key], other[key], customizer, strictCheck, valueStack, otherStack))) {
|
|
1040
|
+
result = false;
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
if (!skipCtor && key === 'constructor') {
|
|
1044
|
+
skipCtor = true;
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
if (result && !skipCtor) {
|
|
1048
|
+
var valCtor = value.constructor;
|
|
1049
|
+
var othCtor = other.constructor;
|
|
1050
|
+
if (valCtor !== othCtor && !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && 'constructor' in value && 'constructor' in other) {
|
|
1051
|
+
result = false;
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
else {
|
|
1056
|
+
result = false;
|
|
1057
|
+
}
|
|
1058
|
+
valueStack.pop();
|
|
1059
|
+
otherStack.pop();
|
|
1060
|
+
return result;
|
|
1061
|
+
}
|
|
1062
|
+
function isEqual(value, other, customizer, strictCheck) {
|
|
1063
|
+
if (strictCheck === void 0) { strictCheck = false; }
|
|
1064
|
+
if (typeof customizer === 'function') {
|
|
1065
|
+
var result = customizer(value, other);
|
|
1066
|
+
if (result !== undefined) {
|
|
1067
|
+
return !!result;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
return isEqualDeep(value, other, customizer, strictCheck);
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
function isError(value) {
|
|
1074
|
+
if (!isObjectLike(value)) {
|
|
1075
|
+
return false;
|
|
1076
|
+
}
|
|
1077
|
+
return value instanceof Error || isType(value, ['Error', 'DOMException']);
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
function isFinite(value) {
|
|
1081
|
+
return numberIsFinite ? numberIsFinite(value) : typeof value === 'number' && root.isFinite(value);
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
function isInteger(value) {
|
|
1085
|
+
return numberIsInteger ? numberIsInteger(value) : isFinite(value) && Math.floor(value) === value;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
function isNumber(value) {
|
|
1089
|
+
return typeof value === 'number' || (isObjectLike(value) && isType(value, 'Number'));
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
function isNaN(value) {
|
|
1093
|
+
return isNumber(value) && root.isNaN(value);
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
function isNull(value) {
|
|
1097
|
+
return value === null;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
function isPromiseLike(value) {
|
|
1101
|
+
return isObject(value) && typeof value.then === 'function';
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
function isRegExp(value) {
|
|
1105
|
+
return nodeIsRegExp ? nodeIsRegExp(value) : isObjectLike(value) && isType(value, 'RegExp');
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
function isSafeInteger(value) {
|
|
1109
|
+
return numberIsSafeInteger ? numberIsSafeInteger(value) : isInteger(value) && Math.abs(value) <= MAX_SAFE_INTEGER;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
function isString(value) {
|
|
1113
|
+
return typeof value === 'string' || (isObjectLike(value) && isType(value, 'String'));
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
function isUndefined(value) {
|
|
1117
|
+
return value === void 0;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
function isWeakMap(value) {
|
|
1121
|
+
return isObjectLike(value) && isType(value, 'WeakMap');
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
function isWeakSet(value) {
|
|
1125
|
+
return isObjectLike(value) && isType(value, 'WeakSet');
|
|
723
1126
|
}
|
|
724
1127
|
|
|
725
1128
|
function decimalAdjust(type, value, precision) {
|
|
@@ -848,22 +1251,6 @@
|
|
|
848
1251
|
return min + Math.random() * (max - min);
|
|
849
1252
|
}
|
|
850
1253
|
|
|
851
|
-
function getSymbols(object) {
|
|
852
|
-
if (!objectGetOwnPropertySymbols || object === null) {
|
|
853
|
-
return [];
|
|
854
|
-
}
|
|
855
|
-
return objectGetOwnPropertySymbols(object).filter(function (item) {
|
|
856
|
-
return propertyIsEnumerable.call(object, item);
|
|
857
|
-
});
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
function allKeys(object) {
|
|
861
|
-
if (!isObject(object)) {
|
|
862
|
-
return [];
|
|
863
|
-
}
|
|
864
|
-
return Object.keys(object).concat(getSymbols(object));
|
|
865
|
-
}
|
|
866
|
-
|
|
867
1254
|
function getKeysIn(object) {
|
|
868
1255
|
var result = [];
|
|
869
1256
|
for (var key in object) {
|
|
@@ -1088,206 +1475,6 @@
|
|
|
1088
1475
|
return splitCaseWords(string, pattern).reduce(function (prev, cur, index) { return prev + (index ? ' ' : '') + cur.toUpperCase(); }, '');
|
|
1089
1476
|
}
|
|
1090
1477
|
|
|
1091
|
-
function isArguments(value) {
|
|
1092
|
-
if (supportedArgumentsType) {
|
|
1093
|
-
return isObjectLike(value) && isType(value, argType);
|
|
1094
|
-
}
|
|
1095
|
-
return (isObjectLike(value) &&
|
|
1096
|
-
hasOwnProperty.call(value, 'callee') &&
|
|
1097
|
-
!propertyIsEnumerable.call(value, 'callee'));
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
var freeExports = typeof exports === 'object' && exports && !exports.nodeType && exports;
|
|
1101
|
-
var freeModule = freeExports && typeof module === 'object' && module && !module.nodeType && module;
|
|
1102
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
1103
|
-
var freeProcess = moduleExports && root.process;
|
|
1104
|
-
var nodeUtil = (function () {
|
|
1105
|
-
try {
|
|
1106
|
-
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
1107
|
-
if (types) {
|
|
1108
|
-
return types;
|
|
1109
|
-
}
|
|
1110
|
-
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
1111
|
-
}
|
|
1112
|
-
catch (e) {
|
|
1113
|
-
}
|
|
1114
|
-
})();
|
|
1115
|
-
var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer;
|
|
1116
|
-
var nodeIsDate = nodeUtil && nodeUtil.isDate;
|
|
1117
|
-
var nodeIsMap = nodeUtil && nodeUtil.isMap;
|
|
1118
|
-
var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
|
|
1119
|
-
var nodeIsSet = nodeUtil && nodeUtil.isSet;
|
|
1120
|
-
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
1121
|
-
|
|
1122
|
-
function isArrayBuffer(value) {
|
|
1123
|
-
return nodeIsArrayBuffer
|
|
1124
|
-
? nodeIsArrayBuffer(value)
|
|
1125
|
-
: isObjectLike(value) && isType(value, 'ArrayBuffer');
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
function isBlob(value) {
|
|
1129
|
-
return (blobExisted && value instanceof Blob) || isType(value, ['Blob', 'File']);
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
function isBoolean(value) {
|
|
1133
|
-
return value === true || value === false || isType(value, 'Boolean');
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
function isBuffer(value) {
|
|
1137
|
-
if (typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function') {
|
|
1138
|
-
return Buffer.isBuffer(value);
|
|
1139
|
-
}
|
|
1140
|
-
return false;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
function isDataView(value) {
|
|
1144
|
-
return isType(value, 'DataView');
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
function isDate(value) {
|
|
1148
|
-
return nodeIsDate ? nodeIsDate(value) : isObjectLike(value) && isType(value, 'Date');
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
function isPlainObject(value) {
|
|
1152
|
-
if (!isObjectLike(value) || !isType(value, 'Object')) {
|
|
1153
|
-
return false;
|
|
1154
|
-
}
|
|
1155
|
-
var proto = Object.getPrototypeOf(Object(value));
|
|
1156
|
-
if (proto === null) {
|
|
1157
|
-
return true;
|
|
1158
|
-
}
|
|
1159
|
-
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
1160
|
-
return typeof Ctor === 'function' && Ctor instanceof Ctor && functionToString.call(Ctor) === objectCtorString;
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
function isElement(value) {
|
|
1164
|
-
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
function isPrototype(value) {
|
|
1168
|
-
if (typeof value !== 'object') {
|
|
1169
|
-
return false;
|
|
1170
|
-
}
|
|
1171
|
-
var Ctor = value.constructor;
|
|
1172
|
-
var proto = typeof Ctor === 'function' ? Ctor.prototype : objectProto;
|
|
1173
|
-
return value === proto;
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
function keys(value) {
|
|
1177
|
-
if (!isPrototype(value)) {
|
|
1178
|
-
return Object.keys(value);
|
|
1179
|
-
}
|
|
1180
|
-
var result = [];
|
|
1181
|
-
for (var key in Object(value)) {
|
|
1182
|
-
if (hasOwnProperty.call(value, key) && key !== 'constructor') {
|
|
1183
|
-
result.push(key);
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
return result;
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
function isMap(value) {
|
|
1190
|
-
return nodeIsMap ? nodeIsMap(value) : isObjectLike(value) && isType(value, 'Map');
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
function isSet(value) {
|
|
1194
|
-
return nodeIsSet ? nodeIsSet(value) : isObjectLike(value) && isType(value, 'Set');
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
function isEmpty(value) {
|
|
1198
|
-
if (value == null) {
|
|
1199
|
-
return true;
|
|
1200
|
-
}
|
|
1201
|
-
if (isMap(value) || isSet(value)) {
|
|
1202
|
-
return !value.size;
|
|
1203
|
-
}
|
|
1204
|
-
if (isObjectLike(value)) {
|
|
1205
|
-
return !keys(value).length;
|
|
1206
|
-
}
|
|
1207
|
-
if (isArrayLike(value)) {
|
|
1208
|
-
return !value.length;
|
|
1209
|
-
}
|
|
1210
|
-
return true;
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
function isError(value) {
|
|
1214
|
-
if (!isObjectLike(value)) {
|
|
1215
|
-
return false;
|
|
1216
|
-
}
|
|
1217
|
-
return value instanceof Error || isType(value, ['Error', 'DOMException']);
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
function isInteger(value) {
|
|
1221
|
-
return numberIsInteger ? numberIsInteger(value) : isFinite(value) && Math.floor(value) === value;
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
function isNumber(value) {
|
|
1225
|
-
return typeof value === 'number' || (isObjectLike(value) && isType(value, 'Number'));
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
function isNaN(value) {
|
|
1229
|
-
return isNumber(value) && root.isNaN(value);
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
function isNil(value) {
|
|
1233
|
-
return value == null;
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
function isNull(value) {
|
|
1237
|
-
return value === null;
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
function isPromiseLike(value) {
|
|
1241
|
-
return isObject(value) && typeof value.then === 'function';
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
function isRegExp(value) {
|
|
1245
|
-
return nodeIsRegExp ? nodeIsRegExp(value) : isObjectLike(value) && isType(value, 'RegExp');
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
function isSafeInteger(value) {
|
|
1249
|
-
return numberIsSafeInteger
|
|
1250
|
-
? numberIsSafeInteger(value)
|
|
1251
|
-
: isInteger(value) && Math.abs(value) <= MAX_SAFE_INTEGER;
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
function isString(value) {
|
|
1255
|
-
return typeof value === 'string' || (isObjectLike(value) && isType(value, 'String'));
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
function isTypedArray(value) {
|
|
1259
|
-
if (nodeIsTypedArray) {
|
|
1260
|
-
return nodeIsTypedArray(value);
|
|
1261
|
-
}
|
|
1262
|
-
return (isObjectLike(value) &&
|
|
1263
|
-
isLength(value.length) &&
|
|
1264
|
-
isType(value, [
|
|
1265
|
-
'Float32Array',
|
|
1266
|
-
'Float64Array',
|
|
1267
|
-
'Int8Array',
|
|
1268
|
-
'Int16Array',
|
|
1269
|
-
'Int32Array',
|
|
1270
|
-
'Uint8Array',
|
|
1271
|
-
'Uint8ClampedArray',
|
|
1272
|
-
'Uint16Array',
|
|
1273
|
-
'Uint32Array',
|
|
1274
|
-
'BigInt64Array',
|
|
1275
|
-
'BigUint64Array'
|
|
1276
|
-
]));
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
function isUndefined(value) {
|
|
1280
|
-
return value === void 0;
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
function isWeakMap(value) {
|
|
1284
|
-
return isObjectLike(value) && isType(value, 'WeakMap');
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
function isWeakSet(value) {
|
|
1288
|
-
return isObjectLike(value) && isType(value, 'WeakSet');
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
1478
|
function conformsTo(object, source) {
|
|
1292
1479
|
var props = allKeys(source);
|
|
1293
1480
|
var length = props.length;
|
|
@@ -1431,6 +1618,7 @@
|
|
|
1431
1618
|
exports.isDate = isDate;
|
|
1432
1619
|
exports.isElement = isElement;
|
|
1433
1620
|
exports.isEmpty = isEmpty;
|
|
1621
|
+
exports.isEqual = isEqual;
|
|
1434
1622
|
exports.isError = isError;
|
|
1435
1623
|
exports.isFinite = isFinite;
|
|
1436
1624
|
exports.isFunction = isFunction;
|