ifExpr()deprecated
Function in Authoring
Two-arm value dispatch on a condition: ifExpr(cond, () => a, () => b).
import { ifExpr } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
function ifExpr<K extends string>( cond: ReadonlyNode<'bool'>, thenVal: () => ReadonlyNode<K>, elseVal: () => ReadonlyNode<K>,): Node<K>Parameters
condReadonlyNode<'bool'>thenVal() => ReadonlyNode<K>elseVal() => ReadonlyNode<K>
Return value
Node<K>
Source
src/core/ir/builder.ts, line 2052, at commit 26de7be8