Extremely Popular
Go to Latest
method Node.prototype.getFirstAncestorOrThrow
import { Node } from "https://dotland.deno.dev/x/fresh@1.1.5/src/dev/deps.ts";

Gets the first ancestor that matches the provided condition or throws if not found.

Parameters

optional
condition: (node: Node) => node is T
  • Condition to match.

Gets the first ancestor that matches the provided condition or throws if not found.

Parameters

optional
condition: (node: Node) => boolean
  • Condition to match.