@vertigis/react-ui 11.28.0 → 11.28.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/package.json +1 -1
- package/styles/createTheme.js +13 -2
package/package.json
CHANGED
package/styles/createTheme.js
CHANGED
|
@@ -968,13 +968,13 @@ function deepAssign(target, ...sources) {
|
|
|
968
968
|
const sourceObj = Object(source);
|
|
969
969
|
for (const key of Object.keys(sourceObj)) {
|
|
970
970
|
const sourceValue = sourceObj[key];
|
|
971
|
-
if (result[key] &&
|
|
971
|
+
if ((result[key] && isPlainObject(result[key])) || Array.isArray(result[key])) {
|
|
972
972
|
deepAssign(result[key], sourceValue);
|
|
973
973
|
}
|
|
974
974
|
else if (Array.isArray(sourceValue)) {
|
|
975
975
|
result[key] = deepAssign([], sourceValue);
|
|
976
976
|
}
|
|
977
|
-
else if (sourceValue
|
|
977
|
+
else if (isPlainObject(sourceValue)) {
|
|
978
978
|
result[key] = deepAssign({}, sourceValue);
|
|
979
979
|
}
|
|
980
980
|
else {
|
|
@@ -984,3 +984,14 @@ function deepAssign(target, ...sources) {
|
|
|
984
984
|
});
|
|
985
985
|
return result;
|
|
986
986
|
}
|
|
987
|
+
/**
|
|
988
|
+
* Determines whether the argument is a plain instance of Object.
|
|
989
|
+
*
|
|
990
|
+
* @param value The value to check.
|
|
991
|
+
*/
|
|
992
|
+
function isPlainObject(value) {
|
|
993
|
+
return (typeof value === "object" &&
|
|
994
|
+
!Array.isArray(value) &&
|
|
995
|
+
!!value &&
|
|
996
|
+
Object.getPrototypeOf(value) === Object.prototype);
|
|
997
|
+
}
|