@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
19 lines • 716 B
JavaScript
export const mergeObjectsStyles = (target, source) => {
// This condition is necessary to avoid the error: "Maximum call stack size exceeded"
if (typeof target !== 'object' || typeof source !== 'object') {
return source;
}
const mergedObject = { ...target };
for (const key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
if (Object.prototype.hasOwnProperty.call(target, key)) {
mergedObject[key] = mergeObjectsStyles(target[key], source[key]);
}
else {
mergedObject[key] = source[key];
}
}
}
return mergedObject;
};
//# sourceMappingURL=mergeObjectStyles.js.map