@node-red/util 5.0.8 → 5.0.9
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/lib/util.js +9 -0
- package/package.json +1 -1
package/lib/util.js
CHANGED
|
@@ -171,6 +171,15 @@ function compareObjects(obj1,obj2) {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
var isDate1 = obj1 instanceof Date;
|
|
175
|
+
var isDate2 = obj2 instanceof Date;
|
|
176
|
+
if (isDate1 != isDate2) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
if (isDate1 && isDate2) {
|
|
180
|
+
return obj1.getTime() === obj2.getTime();
|
|
181
|
+
}
|
|
182
|
+
|
|
174
183
|
if (typeof obj1 !== 'object' || typeof obj2 !== 'object') {
|
|
175
184
|
return false;
|
|
176
185
|
}
|