Skip to main content

Function: resolveId()

function resolveId<T>(
root,
id,
getId?
): T | undefined;

Resolves a node given its ID.

Type Parameters​

Type ParameterDescription
T extends objectTarget object type.

Parameters​

ParameterTypeDefault valueDescription
rootobjectundefinedNode where to start the search. The search will be done on it and all its children.
idstringundefinedID to search for.
getIdRefIdResolvergetModelRefIdFunction that will be used to get the ID from an object (getModelRefId by default).

Returns​

T | undefined

The node found or undefined if none.