ifExpr
On this page

ifExpr()deprecated

Function in Authoring

Two-arm value dispatch on a condition: ifExpr(cond, () => a, () => b).

import { ifExpr } from 'typeshade/core/ir'

The signature, the description and the examples come from the compiler's own source at commit af54ddad5.

Syntax

function ifExpr<K extends string>(
cond: ReadonlyNode<'bool'>,
thenVal: () => ReadonlyNode<K>,
elseVal: () => ReadonlyNode<K>,
): Node<K>

Parameters

cond ReadonlyNode<'bool'>
thenVal () => ReadonlyNode<K>
elseVal () => ReadonlyNode<K>

Return value

Node<K>

Source

src/core/ir/builder.ts, line 1769, at commit af54ddad5

Edit this page Report a problem