From fe85814ec3d6f6f7b10681f994dbde88e5b25ffb Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Mon, 8 Jan 2024 16:18:19 +0100 Subject: [PATCH 1/2] fix(interaction-output): allow stored value to be `null` --- packages/core/src/interaction-output.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/src/interaction-output.ts b/packages/core/src/interaction-output.ts index 68f2bf908..1abb8b36e 100644 --- a/packages/core/src/interaction-output.ts +++ b/packages/core/src/interaction-output.ts @@ -79,7 +79,9 @@ export class InteractionOutput implements WoT.InteractionOutput { async value(): Promise { // the value has been already read? - if (this.parsedValue != null) return this.parsedValue as T; + if (this.parsedValue !== undefined) { + return this.parsedValue as T; + } if (this.dataUsed) { throw new Error("Can't read the stream once it has been already used"); From fcfe687169fcf283cc85e267e645bcd52a7946c7 Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Tue, 9 Jan 2024 08:34:25 +0100 Subject: [PATCH 2/2] fix(interaction-output): restrict value method to DataSchemaValues --- packages/core/src/interaction-output.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/interaction-output.ts b/packages/core/src/interaction-output.ts index 1abb8b36e..21b0b58d1 100644 --- a/packages/core/src/interaction-output.ts +++ b/packages/core/src/interaction-output.ts @@ -77,7 +77,7 @@ export class InteractionOutput implements WoT.InteractionOutput { return data; } - async value(): Promise { + async value(): Promise { // the value has been already read? if (this.parsedValue !== undefined) { return this.parsedValue as T;