@vertigis/react-ui 11.28.0 → 11.29.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertigis/react-ui",
3
- "version": "11.28.0",
3
+ "version": "11.29.0",
4
4
  "description": "Utilities and React components used in VertiGIS applications.",
5
5
  "keywords": [
6
6
  "vertigis",
@@ -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] && typeof result[key] === "object") {
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 && typeof sourceValue === "object") {
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
+ }