Function findAncestorOfType

  • Note that the type is not strictly forced to be a subclass of Node. This is intended to support interfaces like Statement or Expression. However, being an ancestor the returned value is guaranteed to be a Node, as only Node instances can be part of the hierarchy.

    Parameters

    • node: undefined | Node
    • type: any

    Returns Node | undefined

    ancestor the nearest ancestor of this node that is of type type.

Generated using TypeDoc