when
when<
T,V>(predicate,then,description?):MatchCase<T>
Defined in: extract/spec.ts:523
Create a match case with a predicate and result spec.
Type Parameters
Section titled “Type Parameters”T extends Spec
V = unknown
Parameters
Section titled “Parameters”predicate
Section titled “predicate”Function that tests the value, or a predicate factory result
T
Spec to use when predicate returns true
description?
Section titled “description?”string
Optional description for AST introspection (defaults to predicate.toString())
Returns
Section titled “Returns”MatchCase<T>