@duet3d/objectmodel 3.5.0-rc.15 → 3.5.0-rc.17
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/ModelObject.js +21 -0
- package/dist/boards/index.d.ts +1 -0
- package/dist/boards/index.js +1 -0
- package/package.json +2 -2
package/dist/ModelObject.js
CHANGED
|
@@ -101,6 +101,27 @@ class ModelObject {
|
|
|
101
101
|
console.warn(`Model set ${key} could not be changed because the target type ${typeof value} is invalid`);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
+
else if (prop instanceof Map) {
|
|
105
|
+
if (value instanceof Object) {
|
|
106
|
+
// Remove deleted items
|
|
107
|
+
for (let item in prop) {
|
|
108
|
+
if (!(item in value)) {
|
|
109
|
+
prop.delete(item);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Add new items
|
|
113
|
+
for (let item in value) {
|
|
114
|
+
prop.set(item, value[item]);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else if (value === null) {
|
|
118
|
+
// Sets may be assignable to null
|
|
119
|
+
this[ownKey] = value;
|
|
120
|
+
}
|
|
121
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
122
|
+
console.warn(`Model map ${key} could not be changed because the target type ${typeof value} is invalid`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
104
125
|
else if (prop === null || value === null) {
|
|
105
126
|
// Unfortunately we cannot do type checks during runtime without excessive extra work and possibly
|
|
106
127
|
// third-party libraries, so skip them for null values until there is a better solution.
|
package/dist/boards/index.d.ts
CHANGED
package/dist/boards/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duet3d/objectmodel",
|
|
3
|
-
"version": "3.5.0-rc.
|
|
3
|
+
"version": "3.5.0-rc.17",
|
|
4
4
|
"description": "TypeScript implementation of the Duet3D Object Model",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@types/jest": "^29.5.12",
|
|
25
25
|
"jest": "^29.7.0",
|
|
26
26
|
"ts-jest": "^29.1.2",
|
|
27
|
-
"typescript": "^5.
|
|
27
|
+
"typescript": "^5.4.3"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"/dist"
|