@shumoku/core · 0.4.0 · function
isPortLinked
Whether the given port already appears as an endpoint of any link. A physical port models one cable termination, so it can host at most one link at a time. Callers use this to reject attempts to wire a second link onto an already-connected port — `linkExists` only catches exact-duplicate links, which isn't enough for the "1 port = 1 link" invariant.
isPortLinked(links: Link[], nodeId: string, portId: string): boolean Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
links | Link[] | No additional description. | — |
nodeId | string | No additional description. | — |
portId | string | No additional description. | — |
Returns
boolean