Skip to Content
Vue Flow v2 is here and joins xyflow! Read more here →

isNode()

Source on GitHub 

The isNode util is a type guard that returns true when a flow element is a Node, narrowing its type for TypeScript.

import { isNode } from '@xyflow/vue'; const nodesOnly = elements.filter(isNode);

Signature

Parameters:
NameTypeDefault
elementunknown

The element to test.

Returns:
boolean

true if the value can be used as a Node.

Notes

  • See isEdge for the edge counterpart.