diff --git a/.vscode/launch.json b/.vscode/launch.json index e16df8924..5649b4a3b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,6 +10,14 @@ "args": ["--client-only", "counter-client.js"], "cwd": "${workspaceRoot}/examples/scripts/" }, + { + "type": "node", + "request": "launch", + "name": "Launch Counter", + "program": "${workspaceRoot}/packages/cli/dist/cli.js", + "args": ["counter.js"], + "cwd": "${workspaceRoot}/examples/scripts/" + }, { "type": "node", "request": "attach", diff --git a/packages/cli/src/cli-default-servient.ts b/packages/cli/src/cli-default-servient.ts index 57969034a..09f0aed48 100644 --- a/packages/cli/src/cli-default-servient.ts +++ b/packages/cli/src/cli-default-servient.ts @@ -123,7 +123,7 @@ export default class DefaultServient extends Servient { } let coapServer: CoapServer | undefined; - if (this.config.servient.clientOnly == null) { + if (this.config.servient.clientOnly === false) { if (this.config.http != null) { const httpServer = new HttpServer(this.config.http); this.addServer(httpServer); diff --git a/packages/core/src/exposed-thing.ts b/packages/core/src/exposed-thing.ts index d0c080c48..e5dacf716 100644 --- a/packages/core/src/exposed-thing.ts +++ b/packages/core/src/exposed-thing.ts @@ -122,7 +122,9 @@ export default class ExposedThing extends TD.Thing implements WoT.ExposedThing { this.actions = {}; this.events = {}; - const deepClonedModel = structuredClone(thingModel); + // Deep clone the Thing Model + // without functions or methods + const deepClonedModel = JSON.parse(JSON.stringify(thingModel)); Object.assign(this, deepClonedModel); // unset "@type":"tm:ThingModel" ?