@longlast/equals 0.5.5 → 0.5.6
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/index.js +4 -3
- package/package.json +4 -1
package/dist/index.js
CHANGED
|
@@ -105,13 +105,14 @@ function _equals(a, b) {
|
|
|
105
105
|
if (regexConstructorString === aConstructorString) {
|
|
106
106
|
return String(a) === String(b);
|
|
107
107
|
}
|
|
108
|
-
if (
|
|
108
|
+
if (a instanceof Error ||
|
|
109
109
|
nativeErrorConstructorStrings.includes(aConstructorString)) {
|
|
110
110
|
unsafeNarrow(a);
|
|
111
111
|
unsafeNarrow(b);
|
|
112
112
|
return a.message === b.message;
|
|
113
113
|
}
|
|
114
|
-
if (Array.isArray(a)
|
|
114
|
+
if (Array.isArray(a)) {
|
|
115
|
+
unsafeNarrow(b);
|
|
115
116
|
return a.length === b.length && a.every((_, i) => _equals(a[i], b[i]));
|
|
116
117
|
}
|
|
117
118
|
if (setConstructorString === aConstructorString) {
|
|
@@ -157,7 +158,7 @@ function constructorOf(value) {
|
|
|
157
158
|
if (value == null) {
|
|
158
159
|
return null;
|
|
159
160
|
}
|
|
160
|
-
return
|
|
161
|
+
return protoOf(value)?.constructor;
|
|
161
162
|
}
|
|
162
163
|
function unsafeNarrow(value) {
|
|
163
164
|
value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longlast/equals",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.6",
|
|
4
4
|
"description": "Deeply compares objects",
|
|
5
5
|
"homepage": "https://longlast.js.org/",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,5 +19,8 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@longlast/curry": "^0.5.0",
|
|
21
21
|
"@longlast/symbols": "^1.0.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"fast-deep-equal": "3.1.3"
|
|
22
25
|
}
|
|
23
26
|
}
|