Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
method CodeBlockWriter.prototype.conditionalWrite
import { CodeBlockWriter } from "https://deno.land/x/dnt@0.33.1/lib/mod.deps.ts";

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.