@duet3d/objectmodel 3.5.0-beta.16 → 3.5.0-beta.18
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/ModelCollection.js
CHANGED
|
@@ -96,8 +96,7 @@ function initCollection(itemType, data) {
|
|
|
96
96
|
const result = new ModelCollection(itemType);
|
|
97
97
|
for (let presetItem of data) {
|
|
98
98
|
const item = new itemType();
|
|
99
|
-
item.update(presetItem);
|
|
100
|
-
result.push(item);
|
|
99
|
+
result.push(item.update(presetItem));
|
|
101
100
|
}
|
|
102
101
|
return result;
|
|
103
102
|
}
|
package/dist/ModelObject.js
CHANGED
|
@@ -218,33 +218,6 @@ exports.default = ModelObject;
|
|
|
218
218
|
* @returns Initialized model instance
|
|
219
219
|
*/
|
|
220
220
|
function initObject(itemType, data) {
|
|
221
|
-
|
|
222
|
-
for (let key in data) {
|
|
223
|
-
const resultKey = result[key];
|
|
224
|
-
if (isModelObject(resultKey)) {
|
|
225
|
-
const updatedObject = resultKey.update(data[key]);
|
|
226
|
-
if (resultKey !== updatedObject) {
|
|
227
|
-
const propDescriptor = Object.getOwnPropertyDescriptor(result, key);
|
|
228
|
-
if (propDescriptor !== undefined) {
|
|
229
|
-
if (propDescriptor.writable) {
|
|
230
|
-
result[key] = updatedObject;
|
|
231
|
-
}
|
|
232
|
-
else if (propDescriptor.set !== undefined) {
|
|
233
|
-
propDescriptor.set(updatedObject);
|
|
234
|
-
}
|
|
235
|
-
else if (process.env.NODE_ENV !== "production") {
|
|
236
|
-
console.warn(`Model object ${key} changed but it could not be set due to missing setter`);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
else if (process.env.NODE_ENV !== "production") {
|
|
240
|
-
console.warn(`Model object ${key} changed but it lacks the property descriptor`);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
else {
|
|
245
|
-
result[key] = data[key];
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
return result;
|
|
221
|
+
return new itemType().update(data);
|
|
249
222
|
}
|
|
250
223
|
exports.initObject = initObject;
|
|
@@ -7,7 +7,7 @@ var InputShapingType;
|
|
|
7
7
|
InputShapingType["none"] = "none";
|
|
8
8
|
InputShapingType["mzv"] = "mzv";
|
|
9
9
|
InputShapingType["zvd"] = "zvd";
|
|
10
|
-
InputShapingType["zvdd"] = "
|
|
10
|
+
InputShapingType["zvdd"] = "zvdd";
|
|
11
11
|
InputShapingType["zvddd"] = "zvddd";
|
|
12
12
|
InputShapingType["ei2"] = "ei2";
|
|
13
13
|
InputShapingType["ei3"] = "ei3";
|