ut2 1.2.1 → 1.2.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/dist/ut2.js +13 -21
- package/dist/ut2.js.map +1 -1
- package/dist/ut2.min.js +1 -1
- package/dist/ut2.min.js.map +1 -1
- package/es/eq.js +3 -5
- package/es/internals/helpers.js +2 -3
- package/lib/eq.js +3 -5
- package/lib/internals/helpers.js +1 -2
- package/package.json +1 -1
- package/types/eq.d.ts +1 -1
- package/types/internals/helpers.d.ts +0 -1
- package/es/internals/sameValue.js +0 -10
- package/lib/internals/sameValue.js +0 -12
- package/types/internals/sameValue.d.ts +0 -12
package/es/eq.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import sameValue from './internals/sameValue.js';
|
|
2
|
-
|
|
3
1
|
function eq(value, other, strictCheck) {
|
|
4
2
|
if (strictCheck === void 0) { strictCheck = false; }
|
|
5
|
-
if (
|
|
6
|
-
return
|
|
3
|
+
if (value === other) {
|
|
4
|
+
return strictCheck ? value !== 0 || 1 / value === 1 / other : true;
|
|
7
5
|
}
|
|
8
|
-
return value
|
|
6
|
+
return value !== value && other !== other;
|
|
9
7
|
}
|
|
10
8
|
|
|
11
9
|
export { eq as default };
|
package/es/internals/helpers.js
CHANGED
|
@@ -8,7 +8,6 @@ var numberIsInteger = Number.isInteger;
|
|
|
8
8
|
var numberIsSafeInteger = Number.isSafeInteger;
|
|
9
9
|
var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
10
10
|
var arrayAt = Array.prototype.at;
|
|
11
|
-
var
|
|
12
|
-
var VERSION = "1.2.1";
|
|
11
|
+
var VERSION = "1.2.2";
|
|
13
12
|
|
|
14
|
-
export { FUNC_ERROR_TEXT, VERSION, argType, arrayAt, numberIsFinite, numberIsInteger, numberIsSafeInteger, objectGetOwnPropertySymbols,
|
|
13
|
+
export { FUNC_ERROR_TEXT, VERSION, argType, arrayAt, numberIsFinite, numberIsInteger, numberIsSafeInteger, objectGetOwnPropertySymbols, supportedArgumentsType };
|
package/lib/eq.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var sameValue = require('./internals/sameValue.js');
|
|
4
|
-
|
|
5
3
|
function eq(value, other, strictCheck) {
|
|
6
4
|
if (strictCheck === void 0) { strictCheck = false; }
|
|
7
|
-
if (
|
|
8
|
-
return
|
|
5
|
+
if (value === other) {
|
|
6
|
+
return strictCheck ? value !== 0 || 1 / value === 1 / other : true;
|
|
9
7
|
}
|
|
10
|
-
return value
|
|
8
|
+
return value !== value && other !== other;
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
module.exports = eq;
|
package/lib/internals/helpers.js
CHANGED
|
@@ -10,5 +10,4 @@ exports.numberIsInteger = Number.isInteger;
|
|
|
10
10
|
exports.numberIsSafeInteger = Number.isSafeInteger;
|
|
11
11
|
exports.objectGetOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
12
12
|
exports.arrayAt = Array.prototype.at;
|
|
13
|
-
exports.
|
|
14
|
-
exports.VERSION = "1.2.1";
|
|
13
|
+
exports.VERSION = "1.2.2";
|
package/package.json
CHANGED
package/types/eq.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export declare const numberIsInteger: (number: unknown) => boolean;
|
|
|
6
6
|
export declare const numberIsSafeInteger: (number: unknown) => boolean;
|
|
7
7
|
export declare const objectGetOwnPropertySymbols: (o: any) => symbol[];
|
|
8
8
|
export declare const arrayAt: (index: number) => any;
|
|
9
|
-
export declare const objectIs: (value1: any, value2: any) => boolean;
|
|
10
9
|
/**
|
|
11
10
|
* ut2 版本号。
|
|
12
11
|
*
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { objectIs } from './helpers.js';
|
|
2
|
-
|
|
3
|
-
function sameValue(value, other) {
|
|
4
|
-
if (typeof objectIs === 'function') {
|
|
5
|
-
return objectIs(value, other);
|
|
6
|
-
}
|
|
7
|
-
return value === other ? value !== 0 || 1 / value === 1 / other : value != value && other != other;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { sameValue as default };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var helpers = require('./helpers.js');
|
|
4
|
-
|
|
5
|
-
function sameValue(value, other) {
|
|
6
|
-
if (typeof helpers.objectIs === 'function') {
|
|
7
|
-
return helpers.objectIs(value, other);
|
|
8
|
-
}
|
|
9
|
-
return value === other ? value !== 0 || 1 / value === 1 / other : value != value && other != other;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
module.exports = sameValue;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 检查两个值是否相等。
|
|
3
|
-
*
|
|
4
|
-
* @private
|
|
5
|
-
* @see {@link https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Equality_comparisons_and_sameness | JavaScript 中的相等性判断}
|
|
6
|
-
* @see {@link https://tc39.es/ecma262/#sec-samevalue | SameValue}
|
|
7
|
-
* @param {*} value 要比较的值。
|
|
8
|
-
* @param {*} other 另一个要比较的值。
|
|
9
|
-
* @returns {boolean} 如果两个值相等返回 `true`, 否则返回 `false` 。
|
|
10
|
-
*/
|
|
11
|
-
declare function sameValue(value: any, other: any): boolean;
|
|
12
|
-
export default sameValue;
|