@duet3d/objectmodel 3.4.0-b14 → 3.4.0-b15

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.
@@ -72,7 +72,14 @@ class ModelCollection extends Array {
72
72
  }
73
73
  // Add new items
74
74
  for (let i = this.length; i < jsonElement.length; i++) {
75
- this.push(jsonElement[i]);
75
+ const itemToAdd = jsonElement[i];
76
+ if (itemToAdd === null) {
77
+ super.push(itemToAdd);
78
+ }
79
+ else {
80
+ const newItem = new this.itemConstructor();
81
+ super.push(newItem.update(itemToAdd));
82
+ }
76
83
  }
77
84
  return this;
78
85
  }
package/package.json CHANGED
@@ -1,30 +1,32 @@
1
- {
2
- "name": "@duet3d/objectmodel",
3
- "version": "3.4.0-b14",
4
- "description": "TypeScript implementation of the Duet3D Object Model",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "test": "jest --config jestconfig.json",
9
- "build": "tsc",
10
- "prepare" : "npm run build",
11
- "prepublishOnly" : "npm test"
12
- },
13
- "repository": {
14
- "type": "git",
15
- "url": "git+https://github.com/Duet3D/ObjectModel.git"
16
- },
17
- "author": "Christian Hammacher",
18
- "license": "LGPL-2.1",
19
- "bugs": {
20
- "url": "https://github.com/Duet3D/ObjectModel/issues"
21
- },
22
- "homepage": "https://github.com/Duet3D/ObjectModel#readme",
23
- "devDependencies": {
24
- "@types/jest": "^27.0.3",
25
- "jest": "^27.4.5",
26
- "ts-jest": "^27.1.2",
27
- "typescript": "^4.5.2"
28
- },
29
- "files": ["/dist"]
30
- }
1
+ {
2
+ "name": "@duet3d/objectmodel",
3
+ "version": "3.4.0-b15",
4
+ "description": "TypeScript implementation of the Duet3D Object Model",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "test": "jest --config jestconfig.json",
9
+ "build": "tsc",
10
+ "prepare": "npm run build",
11
+ "prepublishOnly": "npm test"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/Duet3D/ObjectModel.git"
16
+ },
17
+ "author": "Christian Hammacher",
18
+ "license": "LGPL-2.1",
19
+ "bugs": {
20
+ "url": "https://github.com/Duet3D/ObjectModel/issues"
21
+ },
22
+ "homepage": "https://github.com/Duet3D/ObjectModel#readme",
23
+ "devDependencies": {
24
+ "@types/jest": "^27.5.0",
25
+ "jest": "^27.5.1",
26
+ "ts-jest": "^27.1.4",
27
+ "typescript": "^4.6.4"
28
+ },
29
+ "files": [
30
+ "/dist"
31
+ ]
32
+ }