isJSON
True when text is valid JSON.
Details #
isJSON(value) is true when the text parses as JSON. It never fails, so test before calling json.
Parameters #
Takes 1 argument.
{{ isJSON(text) }}
Examples #
isJSON("{\"a\": 1}")→
trueisJSON("[1,")→
falseGotchas #
A lone number or
trueis valid JSON, soisJSON("42")is true.Only text can be JSON: a list or a record gives false.