visitNodes

external fun <TIn : Node, TInArray : NodeArray<TIn>?> visitNodes(nodes: TInArray, visitor: Visitor<TIn, Node?>, test: (node: Node) -> Boolean = definedExternally, start: Double = definedExternally, count: Double = definedExternally): Any(source)

Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.

  • If the input node array is undefined, the output is undefined.

  • If the visitor can return undefined, the node it visits in the array will be reused.

  • If the output node array is not undefined, then its contents will satisfy the test.

  • In order to obtain a return type that is more specific than NodeArray<Node>, a test function must be provided, and that function must be a type predicate.

Parameters

nodes

The NodeArray to visit.

visitor

The callback used to visit a Node.

test

A node test to execute for each node.

start

An optional value indicating the starting offset at which to start visiting.

count

An optional value indicating the maximum number of nodes to visit.