Skip to main content

$$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​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryarrayYesArray of elements
byTransformer(##current)YesA predicate transformer for an element
  • ##current - Current 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