@duet3d/objectmodel 3.4.0-b7 → 3.4.0-b8
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 +19 -0
- package/dist/ObjectModel.d.ts +2 -0
- package/dist/ObjectModel.js +2 -0
- package/package.json +30 -30
package/dist/ModelObject.js
CHANGED
|
@@ -71,6 +71,25 @@ class ModelObject {
|
|
|
71
71
|
console.warn(`Model array ${key} could not be changed because the target type ${typeof value} is invalid`);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
+
else if (prop instanceof Set) {
|
|
75
|
+
if (value instanceof Array || value instanceof Set) {
|
|
76
|
+
// Remove deleted items
|
|
77
|
+
for (let item of new Set(prop)) {
|
|
78
|
+
if (!prop.has(item)) {
|
|
79
|
+
prop.delete(item);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// Add new items
|
|
83
|
+
for (let item of value) {
|
|
84
|
+
if (!prop.has(item)) {
|
|
85
|
+
prop.add(item);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
90
|
+
console.warn(`Model set ${key} could not be changed because the target type ${typeof value} is invalid`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
74
93
|
else if (prop === null || value === null) {
|
|
75
94
|
// Unfortunately we cannot do type checks during runtime without excessive extra work and possibly
|
|
76
95
|
// third-party libraries, so skip them for null values until there is a better solution.
|
package/dist/ObjectModel.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import Job from "./job";
|
|
|
12
12
|
import Limits from "./limits";
|
|
13
13
|
import Message from "./messages";
|
|
14
14
|
import Move from "./move";
|
|
15
|
+
import Network from "./network";
|
|
15
16
|
import Plugin from "./plugins";
|
|
16
17
|
import Scanner from "./scanner";
|
|
17
18
|
import Sensors from "./sensors";
|
|
@@ -33,6 +34,7 @@ export declare class ObjectModel extends ModelObject {
|
|
|
33
34
|
readonly limits: Limits;
|
|
34
35
|
readonly messages: ModelCollection<Message>;
|
|
35
36
|
readonly move: Move;
|
|
37
|
+
readonly network: Network;
|
|
36
38
|
readonly plugins: ModelDictionary<Plugin>;
|
|
37
39
|
readonly scanner: Scanner;
|
|
38
40
|
readonly sensors: Sensors;
|
package/dist/ObjectModel.js
CHANGED
|
@@ -15,6 +15,7 @@ const job_1 = require("./job");
|
|
|
15
15
|
const limits_1 = require("./limits");
|
|
16
16
|
const messages_1 = require("./messages");
|
|
17
17
|
const move_1 = require("./move");
|
|
18
|
+
const network_1 = require("./network");
|
|
18
19
|
const plugins_1 = require("./plugins");
|
|
19
20
|
const scanner_1 = require("./scanner");
|
|
20
21
|
const sensors_1 = require("./sensors");
|
|
@@ -38,6 +39,7 @@ class ObjectModel extends ModelObject_1.default {
|
|
|
38
39
|
this.limits = new limits_1.default();
|
|
39
40
|
this.messages = new ModelCollection_1.default(messages_1.default); // must be manually cleared after updates
|
|
40
41
|
this.move = new move_1.default();
|
|
42
|
+
this.network = new network_1.default();
|
|
41
43
|
this.plugins = new ModelDictionary_1.default(true, plugins_1.default);
|
|
42
44
|
this.scanner = new scanner_1.default();
|
|
43
45
|
this.sensors = new sensors_1.default();
|
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@duet3d/objectmodel",
|
|
3
|
-
"version": "3.4.0-
|
|
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-b8",
|
|
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
|
+
}
|