ut2 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -4
- package/dist/ut2.js +26 -38
- package/dist/ut2.js.map +1 -1
- package/dist/ut2.min.js +1 -1
- package/dist/ut2.min.js.map +1 -1
- package/es/internals/compare.js +12 -26
- package/es/internals/helpers.js +1 -1
- package/es/isEqual.js +13 -11
- package/lib/internals/compare.js +12 -26
- package/lib/internals/helpers.js +1 -1
- package/lib/isEqual.js +13 -11
- package/package.json +1 -1
- package/types/isBuffer.d.ts +1 -1
package/es/internals/compare.js
CHANGED
|
@@ -2,41 +2,27 @@ import isSymbol from '../isSymbol.js';
|
|
|
2
2
|
import toString from '../toString.js';
|
|
3
3
|
|
|
4
4
|
function compareAsc(value, other) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
if (isSymbol(other)) {
|
|
12
|
-
return -1;
|
|
13
|
-
}
|
|
14
|
-
var valStr = toString(value);
|
|
15
|
-
var othStr = toString(other);
|
|
16
|
-
if (valStr > othStr) {
|
|
5
|
+
var valueIsSymbol = isSymbol(value);
|
|
6
|
+
var otherIsSymbol = isSymbol(other);
|
|
7
|
+
var valueStr = toString(value);
|
|
8
|
+
var otherStr = toString(other);
|
|
9
|
+
if (!otherIsSymbol && (valueIsSymbol || valueStr > otherStr)) {
|
|
17
10
|
return 1;
|
|
18
11
|
}
|
|
19
|
-
if (
|
|
12
|
+
if (!valueIsSymbol && (otherIsSymbol || valueStr < otherStr)) {
|
|
20
13
|
return -1;
|
|
21
14
|
}
|
|
22
15
|
return 0;
|
|
23
16
|
}
|
|
24
17
|
function compareDesc(value, other) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
if (isSymbol(other)) {
|
|
32
|
-
return 1;
|
|
33
|
-
}
|
|
34
|
-
var valStr = toString(value);
|
|
35
|
-
var othStr = toString(other);
|
|
36
|
-
if (valStr > othStr) {
|
|
18
|
+
var valueIsSymbol = isSymbol(value);
|
|
19
|
+
var otherIsSymbol = isSymbol(other);
|
|
20
|
+
var valueStr = toString(value);
|
|
21
|
+
var otherStr = toString(other);
|
|
22
|
+
if (!otherIsSymbol && (valueIsSymbol || valueStr > otherStr)) {
|
|
37
23
|
return -1;
|
|
38
24
|
}
|
|
39
|
-
if (
|
|
25
|
+
if (!valueIsSymbol && (otherIsSymbol || valueStr < otherStr)) {
|
|
40
26
|
return 1;
|
|
41
27
|
}
|
|
42
28
|
return 0;
|
package/es/internals/helpers.js
CHANGED
|
@@ -9,6 +9,6 @@ var numberIsInteger = Number.isInteger;
|
|
|
9
9
|
var numberIsSafeInteger = Number.isSafeInteger;
|
|
10
10
|
var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
11
11
|
var arrayAt = arrayProto.at;
|
|
12
|
-
var VERSION = "1.3.
|
|
12
|
+
var VERSION = "1.3.2";
|
|
13
13
|
|
|
14
14
|
export { FUNC_ERROR_TEXT, VERSION, argType, arrayAt, numberIsFinite, numberIsInteger, numberIsSafeInteger, objectGetOwnPropertySymbols, supportedArgumentsType };
|
package/es/isEqual.js
CHANGED
|
@@ -14,7 +14,7 @@ function mapToArray(map) {
|
|
|
14
14
|
map.forEach(function (value, key) {
|
|
15
15
|
result.push([key, value]);
|
|
16
16
|
});
|
|
17
|
-
return orderBy(result,
|
|
17
|
+
return orderBy(result, [0, 1]);
|
|
18
18
|
}
|
|
19
19
|
function setToArray(set) {
|
|
20
20
|
var result = [];
|
|
@@ -122,13 +122,14 @@ function isEqualDeep(value, other, customizer, strictCheck, valueStack, otherSta
|
|
|
122
122
|
if (hasCustomizer) {
|
|
123
123
|
var compared = customizer(value[length], other[length], length, value, other, valueStack, otherStack);
|
|
124
124
|
if (compared !== undefined) {
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
if (!compared) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
continue;
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
if (!isEqualDeep(value[length], other[length], customizer, strictCheck, valueStack, otherStack)) {
|
|
130
|
-
|
|
131
|
-
break;
|
|
132
|
+
return false;
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
}
|
|
@@ -144,23 +145,24 @@ function isEqualDeep(value, other, customizer, strictCheck, valueStack, otherSta
|
|
|
144
145
|
if (hasCustomizer) {
|
|
145
146
|
var compared = customizer(value[key], other[key], key, value, other, valueStack, otherStack);
|
|
146
147
|
if (compared !== undefined) {
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
if (!compared) {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
continue;
|
|
149
152
|
}
|
|
150
153
|
}
|
|
151
154
|
if (!(hasOwnProperty.call(other, key) && isEqualDeep(value[key], other[key], customizer, strictCheck, valueStack, otherStack))) {
|
|
152
|
-
|
|
153
|
-
break;
|
|
155
|
+
return false;
|
|
154
156
|
}
|
|
155
157
|
if (!skipCtor && key === 'constructor') {
|
|
156
158
|
skipCtor = true;
|
|
157
159
|
}
|
|
158
160
|
}
|
|
159
|
-
if (
|
|
161
|
+
if (!skipCtor) {
|
|
160
162
|
var valCtor = value.constructor;
|
|
161
163
|
var othCtor = other.constructor;
|
|
162
164
|
if (valCtor !== othCtor && !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && 'constructor' in value && 'constructor' in other) {
|
|
163
|
-
|
|
165
|
+
return false;
|
|
164
166
|
}
|
|
165
167
|
}
|
|
166
168
|
}
|
package/lib/internals/compare.js
CHANGED
|
@@ -4,41 +4,27 @@ var isSymbol = require('../isSymbol.js');
|
|
|
4
4
|
var toString = require('../toString.js');
|
|
5
5
|
|
|
6
6
|
function compareAsc(value, other) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
if (isSymbol(other)) {
|
|
14
|
-
return -1;
|
|
15
|
-
}
|
|
16
|
-
var valStr = toString(value);
|
|
17
|
-
var othStr = toString(other);
|
|
18
|
-
if (valStr > othStr) {
|
|
7
|
+
var valueIsSymbol = isSymbol(value);
|
|
8
|
+
var otherIsSymbol = isSymbol(other);
|
|
9
|
+
var valueStr = toString(value);
|
|
10
|
+
var otherStr = toString(other);
|
|
11
|
+
if (!otherIsSymbol && (valueIsSymbol || valueStr > otherStr)) {
|
|
19
12
|
return 1;
|
|
20
13
|
}
|
|
21
|
-
if (
|
|
14
|
+
if (!valueIsSymbol && (otherIsSymbol || valueStr < otherStr)) {
|
|
22
15
|
return -1;
|
|
23
16
|
}
|
|
24
17
|
return 0;
|
|
25
18
|
}
|
|
26
19
|
function compareDesc(value, other) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
if (isSymbol(other)) {
|
|
34
|
-
return 1;
|
|
35
|
-
}
|
|
36
|
-
var valStr = toString(value);
|
|
37
|
-
var othStr = toString(other);
|
|
38
|
-
if (valStr > othStr) {
|
|
20
|
+
var valueIsSymbol = isSymbol(value);
|
|
21
|
+
var otherIsSymbol = isSymbol(other);
|
|
22
|
+
var valueStr = toString(value);
|
|
23
|
+
var otherStr = toString(other);
|
|
24
|
+
if (!otherIsSymbol && (valueIsSymbol || valueStr > otherStr)) {
|
|
39
25
|
return -1;
|
|
40
26
|
}
|
|
41
|
-
if (
|
|
27
|
+
if (!valueIsSymbol && (otherIsSymbol || valueStr < otherStr)) {
|
|
42
28
|
return 1;
|
|
43
29
|
}
|
|
44
30
|
return 0;
|
package/lib/internals/helpers.js
CHANGED
|
@@ -11,4 +11,4 @@ exports.numberIsInteger = Number.isInteger;
|
|
|
11
11
|
exports.numberIsSafeInteger = Number.isSafeInteger;
|
|
12
12
|
exports.objectGetOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
13
13
|
exports.arrayAt = native.arrayProto.at;
|
|
14
|
-
exports.VERSION = "1.3.
|
|
14
|
+
exports.VERSION = "1.3.2";
|
package/lib/isEqual.js
CHANGED
|
@@ -16,7 +16,7 @@ function mapToArray(map) {
|
|
|
16
16
|
map.forEach(function (value, key) {
|
|
17
17
|
result.push([key, value]);
|
|
18
18
|
});
|
|
19
|
-
return orderBy(result,
|
|
19
|
+
return orderBy(result, [0, 1]);
|
|
20
20
|
}
|
|
21
21
|
function setToArray(set) {
|
|
22
22
|
var result = [];
|
|
@@ -124,13 +124,14 @@ function isEqualDeep(value, other, customizer, strictCheck, valueStack, otherSta
|
|
|
124
124
|
if (hasCustomizer) {
|
|
125
125
|
var compared = customizer(value[length], other[length], length, value, other, valueStack, otherStack);
|
|
126
126
|
if (compared !== undefined) {
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
if (!compared) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
continue;
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
if (!isEqualDeep(value[length], other[length], customizer, strictCheck, valueStack, otherStack)) {
|
|
132
|
-
|
|
133
|
-
break;
|
|
134
|
+
return false;
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
137
|
}
|
|
@@ -146,23 +147,24 @@ function isEqualDeep(value, other, customizer, strictCheck, valueStack, otherSta
|
|
|
146
147
|
if (hasCustomizer) {
|
|
147
148
|
var compared = customizer(value[key], other[key], key, value, other, valueStack, otherStack);
|
|
148
149
|
if (compared !== undefined) {
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
if (!compared) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
continue;
|
|
151
154
|
}
|
|
152
155
|
}
|
|
153
156
|
if (!(native.hasOwnProperty.call(other, key) && isEqualDeep(value[key], other[key], customizer, strictCheck, valueStack, otherStack))) {
|
|
154
|
-
|
|
155
|
-
break;
|
|
157
|
+
return false;
|
|
156
158
|
}
|
|
157
159
|
if (!skipCtor && key === 'constructor') {
|
|
158
160
|
skipCtor = true;
|
|
159
161
|
}
|
|
160
162
|
}
|
|
161
|
-
if (
|
|
163
|
+
if (!skipCtor) {
|
|
162
164
|
var valCtor = value.constructor;
|
|
163
165
|
var othCtor = other.constructor;
|
|
164
166
|
if (valCtor !== othCtor && !(isFunction(valCtor) && valCtor instanceof valCtor && isFunction(othCtor) && othCtor instanceof othCtor) && 'constructor' in value && 'constructor' in other) {
|
|
165
|
-
|
|
167
|
+
return false;
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
170
|
}
|
package/package.json
CHANGED