Home > @uniformdev/canvas > findParameterInNodeTree

findParameterInNodeTree() function

Walk a Composition or Entry tree to find parameters or fields based on the predicate returning true

Signature:

Parameters

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

data

</td><td>

ComponentInstance | EntryData | Array<NodeLocationReference>

</td><td>

The composition or entry data

</td></tr> <tr><td>

predicate

</td><td>

(parameter: ComponentParameter>) => boolean

</td><td>

Return true from this function to include the parameter in the results

</td></tr> </tbody></table> Returns:

FindInNodeTreeReference[]

Example

const textReferences = findParameterInNodeTree( composition, (parameter) => parameter.type === 'text' )