Skip to content

#isEmpty

Returns true if the value is an array or string with no contents, false otherwise.

#isEmpty(value)
Category Types and conversionValid in Property value
Name Type Description
value path | array | string The array or string to test.

boolean

source.json
{
"items": [],
"text": "x"
}
transformer.json
{
"items": "#isEmpty($.items)",
"text": "#isEmpty($.text)"
}
output.json
{
"items": true,
"text": false
}

Try it in the playground →

#any · #length