Module

x/fresh/src/dev/deps.ts>Node#getParentWhileKind

The next-gen web framework.
Extremely Popular
Go to Latest
method Node.prototype.getParentWhileKind
import { Node } from "https://dotland.deno.dev/x/fresh@1.6.7/src/dev/deps.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.

Type Parameters

TKind extends SyntaxKind

Parameters

kind: TKind
  • Syntax kind to check for.

Returns

KindToNodeMappings[TKind] | undefined