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

Method isValidTarget

src/node/NodeInputSlot.ts:44–54  ·  view source on GitHub ↗
(fromSlot: INodeInputSlot | INodeOutputSlot | SubgraphInput | SubgraphOutput)

Source from the content-addressed store, hash-verified

42 }
43
44 override isValidTarget(fromSlot: INodeInputSlot | INodeOutputSlot | SubgraphInput | SubgraphOutput): boolean {
45 if ("links" in fromSlot) {
46 return LiteGraph.isValidConnection(fromSlot.type, this.type)
47 }
48
49 if (isSubgraphInput(fromSlot)) {
50 return LiteGraph.isValidConnection(fromSlot.type, this.type)
51 }
52
53 return false
54 }
55
56 override draw(ctx: CanvasRenderingContext2D, options: Omit<IDrawOptions, "doStroke" | "labelPosition">) {
57 const { textAlign } = ctx

Callers 2

drawSlotsMethod · 0.45

Calls 2

isSubgraphInputFunction · 0.90
isValidConnectionMethod · 0.80

Tested by

no test coverage detected