devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
28 lines (27 loc) • 958 B
JavaScript
/**
* DevExtreme (cjs/__internal/core/r1/utils/shallow_equals.js)
* Version: 24.2.6
* Build date: Mon Mar 17 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.shallowEquals = void 0;
const shallowEquals = (firstObject, secondObject) => {
if (Object.keys(firstObject).length !== Object.keys(secondObject).length) {
return false
}
return Object.entries(firstObject).every((_ref => {
let [key, firstValue] = _ref;
const secondValue = secondObject[key];
if (firstValue instanceof Date && secondValue instanceof Date) {
return firstValue.getTime() === secondValue.getTime()
}
return firstValue === secondValue
}))
};
exports.shallowEquals = shallowEquals;