$$some / $$any
Checks if any elements in an array satisfy a predicate
Usage​
{
"$$some": /* Array of elements */,
"by": /* Transformer(##current) */
}
"$$some(<by>):{input}"
{
"$$any": /* Array of elements */,
"by": /* Transformer(##current) */
}
"$$any(<by>):{input}"
info
predicate by
should resolve to a boolean
value, it uses the truthy logic
Returns​
boolean
Arguments​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
Primary | array | Yes | Array of elements | |
by | Transformer(##current ) | Yes | A predicate transformer for an element
|
Examples​
Input
Definition
Output
[
{
"active": true
},
{
"active": false
}
]
"$$some(##current.active):$"
true
[
{
"active": false
},
{
"active": false
}
]
"$$some(##current.active):$"
false
[
{
"active": true
},
{
"active": false
}
]
{
"$$some": "$",
"by": "##current.active"
}
true
[
{
"active": false
},
{
"active": false
}
]
{
"$$some": "$",
"by": "##current.active"
}
false
[
{
"active": true
},
{
"active": false
}
]
{
"$$any": "$",
"by": "##current.active"
}
true