react-app-store-manager 1.2.0 → 1.2.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/dist/index.js +17 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -26,32 +26,28 @@ var Store = /** @class */ (function () {
|
|
26
26
|
}
|
27
27
|
};
|
28
28
|
Store.prototype.isEqual = function (newValue, oldValue) {
|
29
|
-
switch (typeof newValue) {
|
30
|
-
case
|
31
|
-
|
32
|
-
case "boolean":
|
33
|
-
case "undefined":
|
34
|
-
case "bigint":
|
35
|
-
case "symbol": {
|
36
|
-
return oldValue === newValue;
|
37
|
-
}
|
38
|
-
case "function": {
|
39
|
-
return (newValue === null || newValue === void 0 ? void 0 : newValue.toString()) === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.toString());
|
40
|
-
}
|
41
|
-
case "object": {
|
42
|
-
if (!Object.keys(newValue) && Object.keys(newValue)) {
|
29
|
+
switch (typeof (newValue)) {
|
30
|
+
case 'object':
|
31
|
+
if (newValue instanceof Date && oldValue instanceof Date && String(newValue) !== String(oldValue))
|
43
32
|
return false;
|
44
|
-
}
|
45
33
|
for (var prop in newValue) {
|
46
|
-
if (
|
34
|
+
if (newValue.hasOwnProperty(prop) !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.hasOwnProperty(prop)))
|
35
|
+
return false;
|
36
|
+
if (!this.isEqual(newValue === null || newValue === void 0 ? void 0 : newValue[prop], oldValue === null || oldValue === void 0 ? void 0 : oldValue[prop]))
|
37
|
+
return false;
|
38
|
+
}
|
39
|
+
for (var prop in oldValue) {
|
40
|
+
if (typeof (newValue[prop]) == 'undefined')
|
47
41
|
return false;
|
48
|
-
}
|
49
42
|
}
|
50
43
|
break;
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
44
|
+
case 'function':
|
45
|
+
if (typeof (oldValue) !== 'function' || (newValue.toString() != oldValue.toString()))
|
46
|
+
return false;
|
47
|
+
break;
|
48
|
+
default:
|
49
|
+
if (newValue != oldValue)
|
50
|
+
return false;
|
55
51
|
}
|
56
52
|
return true;
|
57
53
|
};
|