From 574a4ee440bbec8ef16fbeab3912ee213b15b706 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Sat, 14 Sep 2024 17:02:22 +0900 Subject: [PATCH] Fix configure trying to write to getter field (#143) * Fix configure trying to write to getter field * Only add getter for nodes and groups --- public/litegraph.d.ts | 4 ---- src/litegraph.js | 17 +---------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/public/litegraph.d.ts b/public/litegraph.d.ts index f2ac7444e..356233fc5 100644 --- a/public/litegraph.d.ts +++ b/public/litegraph.d.ts @@ -437,10 +437,6 @@ export declare class LGraph { get nodes(): LGraphNode[]; get groups(): LGraphGroup[]; - get nodes_by_id(): Record; - get nodes_executable(): (LGraphNode & { onExecute: NonNullable }[] | null); - get nodes_in_order(): LGraphNode[]; - get version(): number; getSupportedTypes(): string[]; /** Removes all nodes from this graph */ diff --git a/src/litegraph.js b/src/litegraph.js index 635e10fc6..dd45060b0 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -877,22 +877,6 @@ const globalExport = {}; return this._groups; } - get nodes_by_id() { - return this._nodes_by_id; - } - - get nodes_executable() { - return this._nodes_executable; - } - - get nodes_in_order() { - return this._nodes_in_order; - } - - get version() { - return this._version; - } - /** * Attach Canvas to this graph * @method attachCanvas @@ -2155,6 +2139,7 @@ const globalExport = {}; for (var i in data) { if (i == "nodes" || i == "groups") //links must be accepted continue; + this[i] = data[i]; }