condExpr
On this page

condExpr()deprecated

Function in Authoring

N-arm value dispatch on conditions, the first true condition winning: condExpr([[c0, () => e0], [c1, () => e1]], () => eN).

import { condExpr } from 'typeshade'

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

Syntax

function condExpr<K extends string>(
arms: ReadonlyArray<readonly [ReadonlyNode<'bool'>, () => ReadonlyNode<K>]>,
elseVal: () => ReadonlyNode<K>,
): Node<K>

Parameters

arms ReadonlyArray<readonly [ReadonlyNode<'bool'>, () => ReadonlyNode<K>]>
elseVal () => ReadonlyNode<K>

Return value

Node<K>

Source

src/core/ir/builder.ts, line 2066, at commit 26de7be8

Edit this page Report a problem