Skip to Content
You are viewing the v1 docs of Svelte Flow. You can find the latest version here.

isEdge()

Test whether an object is usable as an Edge. In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true.

import { isEdge } from '@xyflow/svelte'; const edge = { id: 'edge-a', source: 'a', target: 'b', }; if (isEdge(edge)) { // .. }

Signature

Parameters:
NameTypeDefault
elementunknown

The element to test

Returns:
boolean

A boolean indicating whether the element is an Edge

Last updated on