Skip to content

ChainGraph API Documentation / @badaitech/chaingraph-types / isDescendant

Function: isDescendant()

isDescendant<TNode, TEntity>(tree, nodeId, potentialAncestorId): boolean

Defined in: packages/chaingraph-types/src/hierarchy/tree-builder.ts:177

Checks if a node is a descendant of another node

Type Parameters

TNode

TNode = ITreeNode<Record<string, any>>

TEntity

TEntity = any

Parameters

tree

TreeNodeUI<TNode, TEntity>[]

nodeId

string

potentialAncestorId

string

Returns

boolean

Licensed under BUSL-1.1