assert — evaluate an assertion
assert <expr>
The assert
operator evaluates the Boolean expression <expr>
for each
input value, yielding its input value if <expr>
evaluates to true or a
structured error if it does not.
echo {a:1} | super -z -c 'assert a > 0' -
=>
{a:1}
echo {a:-1} | super -z -c 'assert a > 0' -
=>
error({message:"assertion failed",expr:"a > 0",on:{a:-1}})