From 51152a0fe38eb07e3c79b4676f78639c02ed7611 Mon Sep 17 00:00:00 2001 From: louistiti Date: Tue, 16 May 2023 23:07:12 +0800 Subject: [PATCH] refactor(bridge/nodejs): `protected` memory constructor --- bridges/nodejs/src/sdk/memory.ts | 1 + bridges/nodejs/src/sdk/widget.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bridges/nodejs/src/sdk/memory.ts b/bridges/nodejs/src/sdk/memory.ts index 5181aaa0..2f5e271d 100644 --- a/bridges/nodejs/src/sdk/memory.ts +++ b/bridges/nodejs/src/sdk/memory.ts @@ -61,6 +61,7 @@ export class Memory { `You cannot read the memory "${this.name}" as it belongs to another skill which haven't written to this memory yet` ) } + try { if (!fs.existsSync(this.memoryPath)) { await this.clear() diff --git a/bridges/nodejs/src/sdk/widget.ts b/bridges/nodejs/src/sdk/widget.ts index 2c6070b9..8a32e90c 100644 --- a/bridges/nodejs/src/sdk/widget.ts +++ b/bridges/nodejs/src/sdk/widget.ts @@ -2,7 +2,7 @@ export abstract class Widget { public readonly type: string public readonly options: T - public constructor(options: T) { + protected constructor(options: T) { this.type = this.constructor.name this.options = options }