Skip to main content
Module

x/ts_morph/ts_morph.js>CodeBlockWriter#conditionalWrite

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
method CodeBlockWriter.prototype.conditionalWrite
Re-export
import { CodeBlockWriter } from "https://deno.land/x/ts_morph@15.1.0/ts_morph.js";

Conditionally writes text.

Parameters

condition: boolean | undefined
  • Condition to evaluate.
textFunc: () => string
  • A function that returns a string to write if the condition is true.

Conditionally writes text.

Parameters

condition: boolean | undefined
  • Condition to evaluate.
text: string
  • Text to write if the condition is true.