MCPcopy Create free account
hub / github.com/Comfy-Org/litegraph.js / findSlotByType

Method findSlotByType

src/LGraphNode.ts:2257–2279  ·  view source on GitHub ↗
(
    input: boolean,
    type: ISlotType,
    returnObj?: boolean,
    preferFreeSlot?: boolean,
    doNotUseOccupied?: boolean,
  )

Source from the content-addressed store, hash-verified

2255 doNotUseOccupied?: boolean,
2256 ): INodeOutputSlot | -1
2257 findSlotByType(
2258 input: boolean,
2259 type: ISlotType,
2260 returnObj?: boolean,
2261 preferFreeSlot?: boolean,
2262 doNotUseOccupied?: boolean,
2263 ): number | INodeOutputSlot | INodeInputSlot {
2264 return input
2265 ? this.#findSlotByType(
2266 this.inputs,
2267 type,
2268 returnObj,
2269 preferFreeSlot,
2270 doNotUseOccupied,
2271 )
2272 : this.#findSlotByType(
2273 this.outputs,
2274 type,
2275 returnObj,
2276 preferFreeSlot,
2277 doNotUseOccupied,
2278 )
2279 }
2280
2281 /**
2282 * Finds a matching slot from those provided, returning the slot itself or its index in {@link slots}.

Callers 1

findConnectByTypeSlotMethod · 0.80

Calls 1

#findSlotByTypeMethod · 0.95

Tested by

no test coverage detected