RosettaCodeData/Task/Conditional-structures/Jq/conditional-structures-4.jq

8 lines
177 B
Plaintext

exp
| if . == true then "true"
elif . == false then "false"
elif . == null then "maybe"
elif type == "string" then .
else error("unexpected value: \(.)")
end