domutils
    Preparing search index...

    Function filter

    • Search a node and its children for nodes passing a test function. If node is not an array, it will be wrapped in one.

      Type Parameters

      • T extends AnyNode

      Parameters

      • isMatch: (element: AnyNode) => element is T

        Function to test nodes on.

      • node: AnyNode | AnyNode[]

        Node to search. Will be included in the result set if it matches.

      • OptionalshouldRecurse: boolean

        Also consider child nodes.

      • Optionallimit: number

        Maximum number of nodes to return.

      Returns T[]

      All nodes passing isMatch.

    • Search a node and its children for nodes passing a test function. If node is not an array, it will be wrapped in one.

      Parameters

      • isMatch: (element: AnyNode) => boolean

        Function to test nodes on.

      • node: AnyNode | AnyNode[]

        Node to search. Will be included in the result set if it matches.

      • OptionalshouldRecurse: boolean

        Also consider child nodes.

      • Optionallimit: number

        Maximum number of nodes to return.

      Returns AnyNode[]

      All nodes passing isMatch.