@duet3d/objectmodel 3.5.0-b2 → 3.5.0-b3
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/dist/ModelDictionary.js +5 -0
- package/dist/ModelObject.js +8 -0
- package/package.json +1 -1
package/dist/ModelDictionary.js
CHANGED
|
@@ -57,6 +57,11 @@ class ModelDictionary extends Map {
|
|
|
57
57
|
if (jsonElement === null) {
|
|
58
58
|
this.clear();
|
|
59
59
|
}
|
|
60
|
+
else if (jsonElement instanceof Map) {
|
|
61
|
+
for (const [key, value] of jsonElement.entries()) {
|
|
62
|
+
this.set(key, value);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
60
65
|
else {
|
|
61
66
|
for (const [key, value] of Object.entries(jsonElement)) {
|
|
62
67
|
this.set(key, value);
|
package/dist/ModelObject.js
CHANGED
|
@@ -145,6 +145,14 @@ class ModelObject {
|
|
|
145
145
|
console.warn(`Incompatible function target type ${typeof value} for property ${key}`);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
+
else if (propType === "object") {
|
|
149
|
+
if (typeof value === "object") {
|
|
150
|
+
this[ownKey] = value;
|
|
151
|
+
}
|
|
152
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
153
|
+
console.warn(`Incompatible object target type ${typeof value} for property ${key}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
148
156
|
else if (process.env.NODE_ENV !== "production") {
|
|
149
157
|
console.warn(`Incompatible type ${propType} for property ${key} (${typeof value})`);
|
|
150
158
|
}
|