From 2e7203134459bc7af74ead3c3d67d2f765bd3243 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Sat, 12 Apr 2025 03:29:53 +1000 Subject: [PATCH] [API] Remove deprecated: getAncestors (#919) Removes unused and deprecated API: LGraph.getAncestors --- src/LGraph.ts | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/LGraph.ts b/src/LGraph.ts index c4ce3befc..e6cd811fd 100644 --- a/src/LGraph.ts +++ b/src/LGraph.ts @@ -601,40 +601,6 @@ export class LGraph implements LinkNetwork, Serialisable { return L } - /** - * @deprecated Will be removed in 0.9 - * Returns all the nodes that could affect this one (ancestors) by crawling all the inputs recursively. - * It doesn't include the node itself - * @returns an array with all the LGraphNodes that affect this node, in order of execution - */ - getAncestors(node: LGraphNode): LGraphNode[] { - const ancestors: LGraphNode[] = [] - const pending = [node] - const visited: Dictionary = {} - - while (pending.length) { - const current = pending.shift() - if (!current?.inputs) continue - - if (!visited[current.id] && current != node) { - visited[current.id] = true - ancestors.push(current) - } - - for (let i = 0; i < current.inputs.length; ++i) { - const input = current.getInputNode(i) - if (input && !ancestors.includes(input)) { - pending.push(input) - } - } - } - - ancestors.sort(function (a, b) { - return a.order - b.order - }) - return ancestors - } - /** * Positions every node in a more readable manner */