Skip to content

#endsWith

Returns true if a string ends with the provided substring, false otherwise.

#endsWith(value, suffix)
Category StringsValid in Property value
Name Type Description
value path | string The string to test.
suffix string The expected suffix.

boolean

source.json
{
"file": "report.pdf"
}
transformer.json
{
"result": "#endsWith($.file, '.pdf')"
}
output.json
{
"result": true
}

Try it in the playground →

#startsWith