Function findAncestor

  • Find the first ancestor of a node that matches a condition.

    Parameters

    • node: Node

      the node to start from

    • condition: ((node) => boolean)

      a function that returns true if the node matches

        • (node): boolean
        • Parameters

          • node: Node

          Returns boolean

    Returns Node | null

    the first ancestor that matches the condition, or null if none match

Generated using TypeDoc