Function find

  • find(test: ((elem: AnyNode) => boolean), nodes: AnyNode[], recurse: boolean, limit: number): AnyNode[]
  • Search an array of nodes and their children for nodes passing a test function.


    All nodes passing test.


    • test: ((elem: AnyNode) => boolean)

      Function to test nodes on.

        • (elem: AnyNode): boolean
        • Parameters

          • elem: AnyNode

          Returns boolean

    • nodes: AnyNode[]

      Array of nodes to search.

    • recurse: boolean

      Also consider child nodes.

    • limit: number

      Maximum number of nodes to return.

    Returns AnyNode[]