ut2 1.5.2 → 1.5.4
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 +2 -2
- package/dist/ut2.js +103 -129
- package/dist/ut2.js.map +1 -1
- package/dist/ut2.min.js +1 -1
- package/dist/ut2.min.js.map +1 -1
- package/es/gt.js +3 -4
- package/es/gte.js +3 -4
- package/es/internals/createExtremum.js +19 -12
- package/es/internals/createIteratee.js +2 -1
- package/es/internals/getTag.js +2 -23
- package/es/internals/getTagWithBugfix.js +6 -6
- package/es/internals/helpers.js +6 -4
- package/es/internals/isEqualDeep.js +178 -0
- package/es/internals/native.js +1 -3
- package/es/isArguments.js +3 -2
- package/es/isArrayBuffer.js +3 -2
- package/es/isBlob.js +3 -2
- package/es/isBoolean.js +3 -2
- package/es/isDate.js +3 -2
- package/es/isEmpty.js +4 -3
- package/es/isEqual.js +1 -175
- package/es/isError.js +3 -2
- package/es/isFunction.js +3 -2
- package/es/isMatch.js +10 -11
- package/es/isNumber.js +3 -2
- package/es/isObject.js +1 -1
- package/es/isObjectLike.js +1 -1
- package/es/isRegExp.js +3 -2
- package/es/isString.js +3 -2
- package/es/isSymbol.js +3 -2
- package/es/isTypedArray.js +3 -2
- package/es/isWeakSet.js +3 -2
- package/es/lowerFirst.js +3 -4
- package/es/lt.js +3 -4
- package/es/lte.js +3 -4
- package/es/max.js +2 -4
- package/es/min.js +2 -4
- package/es/nth.js +2 -6
- package/es/omit.js +1 -1
- package/es/omitBy.js +2 -1
- package/es/pickBy.js +2 -1
- package/es/toString.js +1 -1
- package/es/uniq.js +13 -5
- package/es/upperFirst.js +3 -4
- package/lib/gt.js +3 -4
- package/lib/gte.js +3 -4
- package/lib/internals/createExtremum.js +19 -12
- package/lib/internals/createIteratee.js +2 -1
- package/lib/internals/getTag.js +1 -22
- package/lib/internals/getTagWithBugfix.js +5 -5
- package/lib/internals/helpers.js +4 -2
- package/lib/internals/isEqualDeep.js +180 -0
- package/lib/internals/native.js +0 -2
- package/lib/isArguments.js +2 -1
- package/lib/isArrayBuffer.js +2 -1
- package/lib/isBlob.js +2 -1
- package/lib/isBoolean.js +2 -1
- package/lib/isDate.js +2 -1
- package/lib/isEmpty.js +4 -3
- package/lib/isEqual.js +1 -175
- package/lib/isError.js +2 -1
- package/lib/isFunction.js +2 -1
- package/lib/isMatch.js +9 -10
- package/lib/isNumber.js +2 -1
- package/lib/isObject.js +1 -1
- package/lib/isObjectLike.js +1 -1
- package/lib/isRegExp.js +2 -1
- package/lib/isString.js +2 -1
- package/lib/isSymbol.js +2 -1
- package/lib/isTypedArray.js +2 -1
- package/lib/isWeakSet.js +2 -1
- package/lib/lowerFirst.js +3 -4
- package/lib/lt.js +3 -4
- package/lib/lte.js +3 -4
- package/lib/max.js +2 -4
- package/lib/min.js +2 -4
- package/lib/nth.js +2 -6
- package/lib/omit.js +1 -1
- package/lib/omitBy.js +2 -1
- package/lib/pickBy.js +2 -1
- package/lib/toString.js +1 -1
- package/lib/uniq.js +13 -5
- package/lib/upperFirst.js +3 -4
- package/package.json +7 -2
- package/types/gt.d.ts +2 -2
- package/types/gte.d.ts +2 -2
- package/types/identity.d.ts +1 -1
- package/types/internals/createExtremum.d.ts +1 -1
- package/types/internals/createIteratee.d.ts +2 -1
- package/types/internals/decimalAdjust.d.ts +1 -1
- package/types/internals/getTag.d.ts +1 -1
- package/types/internals/helpers.d.ts +1 -0
- package/types/internals/isEqualDeep.d.ts +26 -0
- package/types/internals/native.d.ts +0 -2
- package/types/isEqual.d.ts +2 -2
- package/types/lowerFirst.d.ts +2 -2
- package/types/lt.d.ts +2 -2
- package/types/lte.d.ts +2 -2
- package/types/upperFirst.d.ts +2 -2
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var allKeys = require('../allKeys.js');
|
|
4
|
+
var eq = require('../eq.js');
|
|
5
|
+
var getTagWithBugfix = require('./getTagWithBugfix.js');
|
|
6
|
+
var native = require('./native.js');
|
|
7
|
+
var isBuffer = require('../isBuffer.js');
|
|
8
|
+
var isFunction = require('../isFunction.js');
|
|
9
|
+
var isNil = require('../isNil.js');
|
|
10
|
+
var isObjectLike = require('../isObjectLike.js');
|
|
11
|
+
var isTypedArray = require('../isTypedArray.js');
|
|
12
|
+
var orderBy = require('../orderBy.js');
|
|
13
|
+
|
|
14
|
+
var symbolValueOf = native.symbolProto ? native.symbolProto.valueOf : undefined;
|
|
15
|
+
function mapToArray(map) {
|
|
16
|
+
var result = [];
|
|
17
|
+
map.forEach(function (value, key) {
|
|
18
|
+
result.push([key, value]);
|
|
19
|
+
});
|
|
20
|
+
return orderBy(result, [0, 1]);
|
|
21
|
+
}
|
|
22
|
+
function setToArray(set) {
|
|
23
|
+
var result = [];
|
|
24
|
+
set.forEach(function (value) {
|
|
25
|
+
result.push(value);
|
|
26
|
+
});
|
|
27
|
+
return orderBy(result);
|
|
28
|
+
}
|
|
29
|
+
function argToArray(arg) {
|
|
30
|
+
return native.arrayProtoSlice.call(arg);
|
|
31
|
+
}
|
|
32
|
+
function toBufferView(bufferSource) {
|
|
33
|
+
return new Uint8Array(bufferSource.buffer || bufferSource, bufferSource.byteOffset || 0, bufferSource.byteLength);
|
|
34
|
+
}
|
|
35
|
+
function isDomNode(obj) {
|
|
36
|
+
return isObjectLike(obj) && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string' && typeof obj.isEqualNode === 'function';
|
|
37
|
+
}
|
|
38
|
+
function isEqualDeep(value, other, customizer, strictCheck, valueStack, otherStack) {
|
|
39
|
+
if (eq(value, other, strictCheck)) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
var valType = typeof value;
|
|
43
|
+
var othType = typeof other;
|
|
44
|
+
if (strictCheck && valType !== othType) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
if (isNil(value) || isNil(other) || (valType !== 'object' && othType !== 'object')) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
var tag = getTagWithBugfix(value);
|
|
51
|
+
if (tag !== getTagWithBugfix(other)) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
var convert;
|
|
55
|
+
switch (tag) {
|
|
56
|
+
case native.numberTag:
|
|
57
|
+
return eq(+value, +other, strictCheck);
|
|
58
|
+
case native.booleanTag:
|
|
59
|
+
case native.dateTag:
|
|
60
|
+
return strictCheck ? +value === +other : eq(+value, +other);
|
|
61
|
+
case native.stringTag:
|
|
62
|
+
case native.regExpTag:
|
|
63
|
+
return '' + value === '' + other;
|
|
64
|
+
case native.symbolTag:
|
|
65
|
+
return symbolValueOf ? symbolValueOf.call(value) === symbolValueOf.call(other) : false;
|
|
66
|
+
case native.errorTag:
|
|
67
|
+
return value.name === other.name && value.message === other.message;
|
|
68
|
+
case native.dataViewTag:
|
|
69
|
+
case native.arrayBufferTag:
|
|
70
|
+
if (value.byteLength !== other.byteLength || (value.byteOffset && value.byteOffset !== other.byteOffset)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
convert = toBufferView;
|
|
74
|
+
break;
|
|
75
|
+
case native.mapTag:
|
|
76
|
+
convert = mapToArray;
|
|
77
|
+
break;
|
|
78
|
+
case native.setTag:
|
|
79
|
+
convert = setToArray;
|
|
80
|
+
break;
|
|
81
|
+
case native.argumentsTag:
|
|
82
|
+
convert = argToArray;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
if (convert) {
|
|
86
|
+
return isEqualDeep(convert(value), convert(other), customizer, strictCheck, valueStack, otherStack);
|
|
87
|
+
}
|
|
88
|
+
if (isDomNode(value) && isDomNode(other)) {
|
|
89
|
+
return value.isEqualNode(other);
|
|
90
|
+
}
|
|
91
|
+
var areArrays = tag === native.arrayTag;
|
|
92
|
+
if (!areArrays && isTypedArray(value)) {
|
|
93
|
+
if (value.byteLength !== other.byteLength) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
if (value.buffer === other.buffer && value.byteOffset === other.byteOffset) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
areArrays = true;
|
|
100
|
+
}
|
|
101
|
+
if (isBuffer(value)) {
|
|
102
|
+
if (!isBuffer(other)) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
areArrays = true;
|
|
106
|
+
}
|
|
107
|
+
valueStack = valueStack || [];
|
|
108
|
+
otherStack = otherStack || [];
|
|
109
|
+
var length = valueStack.length;
|
|
110
|
+
while (length--) {
|
|
111
|
+
if (valueStack[length] === value) {
|
|
112
|
+
return otherStack[length] === other;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
valueStack.push(value);
|
|
116
|
+
otherStack.push(other);
|
|
117
|
+
var result = true;
|
|
118
|
+
var hasCustomizer = typeof customizer === 'function';
|
|
119
|
+
if (areArrays) {
|
|
120
|
+
length = value.length;
|
|
121
|
+
if (length !== other.length) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
while (length--) {
|
|
125
|
+
if (hasCustomizer) {
|
|
126
|
+
var compared = customizer(value[length], other[length], length, value, other, valueStack, otherStack);
|
|
127
|
+
if (compared !== undefined) {
|
|
128
|
+
if (!compared) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (!isEqualDeep(value[length], other[length], customizer, strictCheck, valueStack, otherStack)) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else if (tag === native.objectTag) {
|
|
140
|
+
var keys = allKeys(value);
|
|
141
|
+
length = keys.length;
|
|
142
|
+
if (allKeys(other).length !== length) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
var skipCtor = false;
|
|
146
|
+
while (length--) {
|
|
147
|
+
var key = keys[length];
|
|
148
|
+
if (hasCustomizer) {
|
|
149
|
+
var compared = customizer(value[key], other[key], key, value, other, valueStack, otherStack);
|
|
150
|
+
if (compared !== undefined) {
|
|
151
|
+
if (!compared) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (!(native.objectProtoHasOwnProperty.call(other, key) && isEqualDeep(value[key], other[key], customizer, strictCheck, valueStack, otherStack))) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
if (!skipCtor && key === 'constructor') {
|
|
161
|
+
skipCtor = true;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (!skipCtor) {
|
|
165
|
+
var valCtor = value.constructor;
|
|
166
|
+
var othCtor = other.constructor;
|
|
167
|
+
if (valCtor !== othCtor && !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && 'constructor' in value && 'constructor' in other) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
result = false;
|
|
174
|
+
}
|
|
175
|
+
valueStack.pop();
|
|
176
|
+
otherStack.pop();
|
|
177
|
+
return result;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
module.exports = isEqualDeep;
|
package/lib/internals/native.js
CHANGED
|
@@ -11,10 +11,8 @@ exports.functionProto = Function.prototype;
|
|
|
11
11
|
exports.functionProtoToString = exports.functionProto.toString;
|
|
12
12
|
var symbolExisted = typeof Symbol !== 'undefined';
|
|
13
13
|
exports.symbolProto = symbolExisted ? Symbol.prototype : undefined;
|
|
14
|
-
exports.symbolToStringTag = symbolExisted ? Symbol.toStringTag : undefined;
|
|
15
14
|
exports.arrayProto = Array.prototype;
|
|
16
15
|
exports.arrayProtoSlice = exports.arrayProto.slice;
|
|
17
|
-
exports.arrayProtoAt = exports.arrayProto.at;
|
|
18
16
|
exports.mathMin = Math.min;
|
|
19
17
|
exports.mathMax = Math.max;
|
|
20
18
|
exports.mathRandom = Math.random;
|
package/lib/isArguments.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
var native = require('./internals/native.js');
|
|
4
4
|
var helpers = require('./internals/helpers.js');
|
|
5
5
|
var isObjectLike = require('./isObjectLike.js');
|
|
6
|
+
var getTag = require('./internals/getTag.js');
|
|
6
7
|
|
|
7
8
|
function isArguments(value) {
|
|
8
9
|
if (helpers.supportedArgumentsType) {
|
|
9
|
-
return
|
|
10
|
+
return getTag(value) === native.argumentsTag;
|
|
10
11
|
}
|
|
11
12
|
return isObjectLike(value) && native.objectProtoHasOwnProperty.call(value, 'callee') && !native.objectProtoPropertyIsEnumerable.call(value, 'callee');
|
|
12
13
|
}
|
package/lib/isArrayBuffer.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
var nodeUtil = require('./internals/nodeUtil.js');
|
|
5
6
|
|
|
6
7
|
function isArrayBuffer(value) {
|
|
7
|
-
return nodeUtil.nodeIsArrayBuffer ? nodeUtil.nodeIsArrayBuffer(value) :
|
|
8
|
+
return nodeUtil.nodeIsArrayBuffer ? nodeUtil.nodeIsArrayBuffer(value) : getTag(value) === native.arrayBufferTag;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
module.exports = isArrayBuffer;
|
package/lib/isBlob.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
|
|
5
6
|
var blobExisted = typeof Blob !== 'undefined';
|
|
@@ -7,7 +8,7 @@ function isBlob(value) {
|
|
|
7
8
|
if (blobExisted && value instanceof Blob) {
|
|
8
9
|
return true;
|
|
9
10
|
}
|
|
10
|
-
return
|
|
11
|
+
return getTag(value) === native.blobTag;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
module.exports = isBlob;
|
package/lib/isBoolean.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
|
|
5
6
|
function isBoolean(value) {
|
|
6
|
-
return value === true || value === false ||
|
|
7
|
+
return value === true || value === false || getTag(value) === native.booleanTag;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
module.exports = isBoolean;
|
package/lib/isDate.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
var nodeUtil = require('./internals/nodeUtil.js');
|
|
5
6
|
|
|
6
7
|
function isDate(value) {
|
|
7
|
-
return nodeUtil.nodeIsDate ? nodeUtil.nodeIsDate(value) :
|
|
8
|
+
return nodeUtil.nodeIsDate ? nodeUtil.nodeIsDate(value) : getTag(value) === native.dateTag;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
module.exports = isDate;
|
package/lib/isEmpty.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var keys = require('./internals/keys.js');
|
|
5
|
+
var native = require('./internals/native.js');
|
|
4
6
|
var isArrayLike = require('./isArrayLike.js');
|
|
5
|
-
var isMap = require('./isMap.js');
|
|
6
7
|
var isObjectLike = require('./isObjectLike.js');
|
|
7
|
-
var isSet = require('./isSet.js');
|
|
8
8
|
|
|
9
9
|
function isEmpty(value) {
|
|
10
10
|
if (value == null) {
|
|
11
11
|
return true;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
var tag = getTag(value);
|
|
14
|
+
if (tag === native.mapTag || tag === native.setTag) {
|
|
14
15
|
return !value.size;
|
|
15
16
|
}
|
|
16
17
|
if (isObjectLike(value)) {
|
package/lib/isEqual.js
CHANGED
|
@@ -1,181 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var eq = require('./eq.js');
|
|
5
|
-
var getTagWithBugfix = require('./internals/getTagWithBugfix.js');
|
|
6
|
-
var native = require('./internals/native.js');
|
|
7
|
-
var isBuffer = require('./isBuffer.js');
|
|
8
|
-
var isFunction = require('./isFunction.js');
|
|
9
|
-
var isNil = require('./isNil.js');
|
|
10
|
-
var isObjectLike = require('./isObjectLike.js');
|
|
11
|
-
var isTypedArray = require('./isTypedArray.js');
|
|
12
|
-
var orderBy = require('./orderBy.js');
|
|
3
|
+
var isEqualDeep = require('./internals/isEqualDeep.js');
|
|
13
4
|
|
|
14
|
-
var symbolValueOf = native.symbolProto ? native.symbolProto.valueOf : undefined;
|
|
15
|
-
function mapToArray(map) {
|
|
16
|
-
var result = [];
|
|
17
|
-
map.forEach(function (value, key) {
|
|
18
|
-
result.push([key, value]);
|
|
19
|
-
});
|
|
20
|
-
return orderBy(result, [0, 1]);
|
|
21
|
-
}
|
|
22
|
-
function setToArray(set) {
|
|
23
|
-
var result = [];
|
|
24
|
-
set.forEach(function (value) {
|
|
25
|
-
result.push(value);
|
|
26
|
-
});
|
|
27
|
-
return orderBy(result);
|
|
28
|
-
}
|
|
29
|
-
function argToArray(arg) {
|
|
30
|
-
return native.arrayProtoSlice.call(arg);
|
|
31
|
-
}
|
|
32
|
-
function toBufferView(bufferSource) {
|
|
33
|
-
return new Uint8Array(bufferSource.buffer || bufferSource, bufferSource.byteOffset || 0, bufferSource.byteLength);
|
|
34
|
-
}
|
|
35
|
-
function isDomNode(obj) {
|
|
36
|
-
return isObjectLike(obj) && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string' && typeof obj.isEqualNode === 'function';
|
|
37
|
-
}
|
|
38
|
-
function isEqualDeep(value, other, customizer, strictCheck, valueStack, otherStack) {
|
|
39
|
-
if (eq(value, other, strictCheck)) {
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
var valType = typeof value;
|
|
43
|
-
var othType = typeof other;
|
|
44
|
-
if (strictCheck && valType !== othType) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
if (isNil(value) || isNil(other) || (valType !== 'object' && othType !== 'object')) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
var tag = getTagWithBugfix(value);
|
|
51
|
-
if (tag !== getTagWithBugfix(other)) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
var convert;
|
|
55
|
-
switch (tag) {
|
|
56
|
-
case native.numberTag:
|
|
57
|
-
return eq(+value, +other, strictCheck);
|
|
58
|
-
case native.booleanTag:
|
|
59
|
-
case native.dateTag:
|
|
60
|
-
return strictCheck ? +value === +other : eq(+value, +other);
|
|
61
|
-
case native.stringTag:
|
|
62
|
-
case native.regExpTag:
|
|
63
|
-
return '' + value === '' + other;
|
|
64
|
-
case native.symbolTag:
|
|
65
|
-
return symbolValueOf ? symbolValueOf.call(value) === symbolValueOf.call(other) : false;
|
|
66
|
-
case native.errorTag:
|
|
67
|
-
return value.name == other.name && value.message == other.message;
|
|
68
|
-
case native.dataViewTag:
|
|
69
|
-
case native.arrayBufferTag:
|
|
70
|
-
if (value.byteLength !== other.byteLength || (value.byteOffset && value.byteOffset !== other.byteOffset)) {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
convert = toBufferView;
|
|
74
|
-
break;
|
|
75
|
-
case native.mapTag:
|
|
76
|
-
convert = mapToArray;
|
|
77
|
-
break;
|
|
78
|
-
case native.setTag:
|
|
79
|
-
convert = setToArray;
|
|
80
|
-
break;
|
|
81
|
-
case native.argumentsTag:
|
|
82
|
-
convert = argToArray;
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
if (convert) {
|
|
86
|
-
return isEqualDeep(convert(value), convert(other), customizer, strictCheck, valueStack, otherStack);
|
|
87
|
-
}
|
|
88
|
-
if (isDomNode(value) && isDomNode(other)) {
|
|
89
|
-
return value.isEqualNode(other);
|
|
90
|
-
}
|
|
91
|
-
var areArrays = tag === native.arrayTag;
|
|
92
|
-
if (!areArrays && isTypedArray(value)) {
|
|
93
|
-
if (value.byteLength !== other.byteLength) {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
if (value.buffer === other.buffer && value.byteOffset === other.byteOffset) {
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
areArrays = true;
|
|
100
|
-
}
|
|
101
|
-
if (isBuffer(value)) {
|
|
102
|
-
if (!isBuffer(other)) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
areArrays = true;
|
|
106
|
-
}
|
|
107
|
-
valueStack = valueStack || [];
|
|
108
|
-
otherStack = otherStack || [];
|
|
109
|
-
var length = valueStack.length;
|
|
110
|
-
while (length--) {
|
|
111
|
-
if (valueStack[length] === value) {
|
|
112
|
-
return otherStack[length] === other;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
valueStack.push(value);
|
|
116
|
-
otherStack.push(other);
|
|
117
|
-
var result = true;
|
|
118
|
-
var hasCustomizer = typeof customizer === 'function';
|
|
119
|
-
if (areArrays) {
|
|
120
|
-
length = value.length;
|
|
121
|
-
if (length !== other.length) {
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
while (length--) {
|
|
125
|
-
if (hasCustomizer) {
|
|
126
|
-
var compared = customizer(value[length], other[length], length, value, other, valueStack, otherStack);
|
|
127
|
-
if (compared !== undefined) {
|
|
128
|
-
if (!compared) {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
if (!isEqualDeep(value[length], other[length], customizer, strictCheck, valueStack, otherStack)) {
|
|
135
|
-
return false;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
else if (tag === native.objectTag) {
|
|
140
|
-
var keys = allKeys(value);
|
|
141
|
-
length = keys.length;
|
|
142
|
-
if (allKeys(other).length !== length) {
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
var skipCtor = false;
|
|
146
|
-
while (length--) {
|
|
147
|
-
var key = keys[length];
|
|
148
|
-
if (hasCustomizer) {
|
|
149
|
-
var compared = customizer(value[key], other[key], key, value, other, valueStack, otherStack);
|
|
150
|
-
if (compared !== undefined) {
|
|
151
|
-
if (!compared) {
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
if (!(native.objectProtoHasOwnProperty.call(other, key) && isEqualDeep(value[key], other[key], customizer, strictCheck, valueStack, otherStack))) {
|
|
158
|
-
return false;
|
|
159
|
-
}
|
|
160
|
-
if (!skipCtor && key === 'constructor') {
|
|
161
|
-
skipCtor = true;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if (!skipCtor) {
|
|
165
|
-
var valCtor = value.constructor;
|
|
166
|
-
var othCtor = other.constructor;
|
|
167
|
-
if (valCtor !== othCtor && !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && 'constructor' in value && 'constructor' in other) {
|
|
168
|
-
return false;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
result = false;
|
|
174
|
-
}
|
|
175
|
-
valueStack.pop();
|
|
176
|
-
otherStack.pop();
|
|
177
|
-
return result;
|
|
178
|
-
}
|
|
179
5
|
function isEqual(value, other, customizer, strictCheck) {
|
|
180
6
|
if (strictCheck === void 0) { strictCheck = false; }
|
|
181
7
|
if (typeof customizer === 'function') {
|
package/lib/isError.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
var isObjectLike = require('./isObjectLike.js');
|
|
5
6
|
|
|
@@ -10,7 +11,7 @@ function isError(value) {
|
|
|
10
11
|
if (value instanceof Error) {
|
|
11
12
|
return true;
|
|
12
13
|
}
|
|
13
|
-
var tag =
|
|
14
|
+
var tag = getTag(value);
|
|
14
15
|
return tag === native.errorTag || tag === native.domExceptionTag;
|
|
15
16
|
}
|
|
16
17
|
|
package/lib/isFunction.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
|
|
5
6
|
function isFunction(value) {
|
|
6
7
|
if (typeof value === 'function') {
|
|
7
8
|
return true;
|
|
8
9
|
}
|
|
9
|
-
var tag =
|
|
10
|
+
var tag = getTag(value);
|
|
10
11
|
return native.functionTags.some(function (item) { return item === tag; });
|
|
11
12
|
}
|
|
12
13
|
|
package/lib/isMatch.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var allKeys = require('./allKeys.js');
|
|
4
|
+
var getTag = require('./internals/getTag.js');
|
|
4
5
|
var native = require('./internals/native.js');
|
|
5
|
-
var
|
|
6
|
+
var isEqualDeep = require('./internals/isEqualDeep.js');
|
|
6
7
|
|
|
7
8
|
function isDeepComparable(object, source) {
|
|
8
|
-
return
|
|
9
|
+
return getTag(object) === native.objectTag && getTag(source) === native.objectTag;
|
|
9
10
|
}
|
|
10
|
-
function baseIsMatch(object, source, customizer, strictCheck, objStack, srcStack
|
|
11
|
-
if (executedCustomizer === void 0) { executedCustomizer = false; }
|
|
11
|
+
function baseIsMatch(object, source, customizer, strictCheck, objStack, srcStack) {
|
|
12
12
|
var hasCustomizer = typeof customizer === 'function';
|
|
13
13
|
if (isDeepComparable(object, source)) {
|
|
14
14
|
objStack = objStack || [];
|
|
@@ -37,7 +37,7 @@ function baseIsMatch(object, source, customizer, strictCheck, objStack, srcStack
|
|
|
37
37
|
continue;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
if (!baseIsMatch(object[key], source[key], customizer, strictCheck, objStack, srcStack
|
|
40
|
+
if (!baseIsMatch(object[key], source[key], customizer, strictCheck, objStack, srcStack)) {
|
|
41
41
|
return false;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -45,18 +45,17 @@ function baseIsMatch(object, source, customizer, strictCheck, objStack, srcStack
|
|
|
45
45
|
srcStack.pop();
|
|
46
46
|
return true;
|
|
47
47
|
}
|
|
48
|
-
var result =
|
|
49
|
-
if (
|
|
48
|
+
var result = isEqualDeep(object, source, function (objValue, srcValue, k, obj, src) {
|
|
49
|
+
if (hasCustomizer) {
|
|
50
50
|
var compared = customizer(objValue, srcValue, k, obj, src, objStack, srcStack);
|
|
51
51
|
if (compared !== undefined) {
|
|
52
52
|
return compared;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
executedCustomizer = false;
|
|
56
55
|
if (isDeepComparable(objValue, srcValue)) {
|
|
57
56
|
return baseIsMatch(objValue, srcValue, customizer, strictCheck, objStack, srcStack);
|
|
58
57
|
}
|
|
59
|
-
}, strictCheck);
|
|
58
|
+
}, strictCheck, objStack, srcStack);
|
|
60
59
|
return result;
|
|
61
60
|
}
|
|
62
61
|
function isMatch(object, source, customizer, strictCheck) {
|
|
@@ -67,7 +66,7 @@ function isMatch(object, source, customizer, strictCheck) {
|
|
|
67
66
|
return !!compared;
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
|
-
return baseIsMatch(object, source, customizer, strictCheck, undefined, undefined
|
|
69
|
+
return baseIsMatch(object, source, customizer, strictCheck, undefined, undefined);
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
module.exports = isMatch;
|
package/lib/isNumber.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
|
|
5
6
|
function isNumber(value) {
|
|
6
|
-
return typeof value === 'number' ||
|
|
7
|
+
return typeof value === 'number' || getTag(value) === native.numberTag;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
module.exports = isNumber;
|
package/lib/isObject.js
CHANGED
package/lib/isObjectLike.js
CHANGED
package/lib/isRegExp.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
var nodeUtil = require('./internals/nodeUtil.js');
|
|
5
6
|
|
|
6
7
|
function isRegExp(value) {
|
|
7
|
-
return nodeUtil.nodeIsRegExp ? nodeUtil.nodeIsRegExp(value) :
|
|
8
|
+
return nodeUtil.nodeIsRegExp ? nodeUtil.nodeIsRegExp(value) : getTag(value) === native.regExpTag;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
module.exports = isRegExp;
|
package/lib/isString.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
|
|
5
6
|
function isString(value) {
|
|
6
|
-
return typeof value === 'string' ||
|
|
7
|
+
return typeof value === 'string' || getTag(value) === native.stringTag;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
module.exports = isString;
|
package/lib/isSymbol.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
|
|
5
6
|
function isSymbol(value) {
|
|
6
|
-
return typeof value === 'symbol' ||
|
|
7
|
+
return typeof value === 'symbol' || getTag(value) === native.symbolTag;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
module.exports = isSymbol;
|
package/lib/isTypedArray.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
var nodeUtil = require('./internals/nodeUtil.js');
|
|
5
6
|
var isLength = require('./isLength.js');
|
|
@@ -10,7 +11,7 @@ function isTypedArray(value) {
|
|
|
10
11
|
return nodeUtil.nodeIsTypedArray(value);
|
|
11
12
|
}
|
|
12
13
|
if (isObjectLike(value) && isLength(value.length)) {
|
|
13
|
-
var tag_1 =
|
|
14
|
+
var tag_1 = getTag(value);
|
|
14
15
|
return native.typedArrayTags.some(function (item) { return item === tag_1; });
|
|
15
16
|
}
|
|
16
17
|
return false;
|
package/lib/isWeakSet.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getTag = require('./internals/getTag.js');
|
|
3
4
|
var native = require('./internals/native.js');
|
|
4
5
|
|
|
5
6
|
function isWeakSet(value) {
|
|
6
|
-
return
|
|
7
|
+
return getTag(value) === native.weakSetTag;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
module.exports = isWeakSet;
|
package/lib/lowerFirst.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var createCaseFirst = require('./internals/createCaseFirst.js');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
5
|
+
var lowerFirst = createCaseFirst('toLowerCase');
|
|
6
|
+
var lowerFirst$1 = lowerFirst;
|
|
8
7
|
|
|
9
|
-
module.exports = lowerFirst;
|
|
8
|
+
module.exports = lowerFirst$1;
|