Module

x/ts_morph/mod.ts>TryStatement

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
class TryStatement
extends TryStatementBase<ts.TryStatement>
import { TryStatement } from "https://dotland.deno.dev/x/ts_morph@20.0.0/mod.ts";

Methods

getCatchClause(): CatchClause | undefined

Gets this try statement's catch clause or undefined if none exists.

getCatchClauseOrThrow(message?: string | (() => string)): CatchClause

Gets this try statement's catch clause or throws if none exists.

getFinallyBlock(): Block | undefined

Gets this try statement's finally block or undefined if none exists.

getFinallyBlockOrThrow(message?: string | (() => string)): Block

Gets this try statement's finally block or throws if none exists.

getParent(): NodeParentType<ts.TryStatement>
getParentOrThrow(message?: string | (() => string)): NonNullable<NodeParentType<ts.TryStatement>>
getTryBlock(): Block

Gets this try statement's try block.