[feat] Replace removeFromArray with lodash pull (#4906)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Christian Byrne
2025-08-11 09:13:02 -07:00
committed by GitHub
parent d22d62b670
commit a1a8d48544
2 changed files with 3 additions and 10 deletions

View File

@@ -1,3 +1,5 @@
import { pull } from 'lodash'
import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
import { LLink } from '@/lib/litegraph/src/LLink'
import type { RerouteId } from '@/lib/litegraph/src/Reroute'
@@ -9,7 +11,6 @@ import type {
} from '@/lib/litegraph/src/interfaces'
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
import { NodeSlotType } from '@/lib/litegraph/src/types/globalEnums'
import { removeFromArray } from '@/lib/litegraph/src/utils/collections'
import type { SubgraphInput } from './SubgraphInput'
import type { SubgraphOutputNode } from './SubgraphOutputNode'
@@ -59,7 +60,7 @@ export class SubgraphOutput extends SubgraphSlot {
existingLink.disconnect(subgraph, 'input')
const resolved = existingLink.resolve(subgraph)
const links = resolved.output?.links
if (links) removeFromArray(links, existingLink.id)
if (links) pull(links, existingLink.id)
}
const link = new LLink(

View File

@@ -112,11 +112,3 @@ export function findFreeSlotOfType<T extends { type: ISlotType }>(
}
return wildSlot ?? occupiedSlot ?? occupiedWildSlot
}
export function removeFromArray<T>(array: T[], value: T): boolean {
const index = array.indexOf(value)
const found = index !== -1
if (found) array.splice(index, 1)
return found
}