Adds "toboolean" builtin function for converting strings to booleans (#2098)
This commit is contained in:
1 parent
92daac90f6
commit
c350566001
5 files changed
+67
No files matched your search
@@ -1477,6 +1477,18 @@ sections:
|
||||
input: '[1, "1"]'
|
||||
output: ['1', '1']
|
||||
|
||||
- title: "`toboolean`"
|
||||
body: |
|
||||
|
||||
The `toboolean` function parses its input as a boolean. It
|
||||
will convert correctly-formatted strings to their boolean
|
||||
equivalent, leave booleans alone, and give an error on all other input.
|
||||
|
||||
examples:
|
||||
- program: '.[] | toboolean'
|
||||
input: '["true", "false", true, false]'
|
||||
output: ['true', 'false', 'true', 'false']
|
||||
|
||||
- title: "`tostring`"
|
||||
body: |
|
||||
|
||||
|
||||
Reference in new issue
Block a user