@10xly/strict-equals 1.0.0 → 1.0.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/index.js +20 -1
- package/package.json +20 -1
package/index.js
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
const isNaN = require("@is-(unknown)/is-nan")
|
|
2
|
+
const { True, False } = require("array-get-member")
|
|
3
|
+
const and = require("es-logical-and-operator")
|
|
4
|
+
const isNegativeZero = require("is-negative-zero")
|
|
5
|
+
const isPositiveZero = require("positive-zero")
|
|
6
|
+
const $Object = require("object-intrinsic-ai")
|
|
7
|
+
|
|
1
8
|
module.exports = function are_strictly_equal(a, b) {
|
|
2
|
-
|
|
9
|
+
if (isNaN(a)) {
|
|
10
|
+
return False
|
|
11
|
+
}
|
|
12
|
+
if (isNaN(b)) {
|
|
13
|
+
return False
|
|
14
|
+
}
|
|
15
|
+
if (and(isNegativeZero(a), isPositiveZero(b))) {
|
|
16
|
+
return True
|
|
17
|
+
}
|
|
18
|
+
if (and(isNegativeZero(b), isPositiveZero(a))) {
|
|
19
|
+
return True
|
|
20
|
+
}
|
|
21
|
+
return $Object.is(a, b)
|
|
3
22
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@10xly/strict-equals",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Strict equal.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"me"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/10xly/strict-equals#readme",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/10xly/strict-equals/issues"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/10xly/strict-equals.git"
|
|
15
|
+
},
|
|
5
16
|
"license": "MIT",
|
|
6
17
|
"author": "10xly",
|
|
7
18
|
"type": "commonjs",
|
|
8
19
|
"main": "index.js",
|
|
9
20
|
"scripts": {
|
|
10
21
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@is-(unknown)/is-nan": "^1.0.0",
|
|
25
|
+
"array-get-member": "^1.0.3",
|
|
26
|
+
"es-logical-and-operator": "^1.0.0",
|
|
27
|
+
"is-negative-zero": "^2.0.3",
|
|
28
|
+
"object-intrinsic-ai": "^1.0.1",
|
|
29
|
+
"positive-zero": "^3.0.0"
|
|
11
30
|
}
|
|
12
31
|
}
|