Skip to main content
Module

x/ts_morph/mod.ts>Node#getParentWhileKind

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Latest
method Node.prototype.getParentWhileKind
import { Node } from "https://deno.land/x/ts_morph@22.0.0/mod.ts";

Goes up the parents (ancestors) of the node while the parent is the specified syntax kind. Returns undefined if the initial parent is not the specified syntax kind.

Parameters

kind: TKind
  • Syntax kind to check for.