Skip to content

Bars Specification 0.1.0 — Transform: has

Category: list · Since: 0.1.0

Reports whether any element matches a predicate.

Returns true/false depending on whether any element (a struct) matches the same predicate as where: with value, elements whose property string-equals value; with no value, elements whose property is truthy.

Input coercion: list

Arguments

Name Type Optional Default
property string no
value string yes

Arity: 1–2

Worked examples

{{ items | has: "k" "b" }}

true
{{ items | has: "ok" }}

true

Full fixture: transforms/transform-has.json