# isPortLinked

Canonical: https://docs.shumoku.dev/en/library/api/isPortLinked
Language: en

@shumoku/core · 0.4.0 · function

# isPortLinked

[Source](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/interaction.ts#L580)

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
```

[`libs/@shumoku/core/src/layout/interaction.ts:580`](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/interaction.ts#L580)
