# linkExists

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

@shumoku/core · 0.4.0 · function

# linkExists

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

Check if a link already exists between two ports.

```
linkExists(links: Link[], fromNodeId: string, fromPort: string, toNodeId: string, toPort: string): boolean
```

## Parameters

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `links` | `Link[]` | No additional description. | `—` |
| `fromNodeId` | `string` | No additional description. | `—` |
| `fromPort` | `string` | No additional description. | `—` |
| `toNodeId` | `string` | No additional description. | `—` |
| `toPort` | `string` | No additional description. | `—` |

## Returns

```
boolean
```

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