Bars Specification 0.1.0 — Transform: find¶
Category: list · Since: 0.1.0
Finds the first element matching a predicate.
Returns the first element (a struct) matching the same predicate as where: with value, elements whose property string-equals value; with no value, elements whose property is truthy. A soft failure (NoMatch, yielding null) fires when nothing matches.
Input coercion: list
Arguments¶
| Name | Type | Optional | Default |
|---|---|---|---|
property |
string | no | — |
value |
string | yes | — |
Arity: 1–2
Worked examples¶
→
→
Full fixture: transforms/transform-find.json