summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/03_stdlib/10_keys
blob: 46462a0923803718a14e0aa88bdfb32c8669884f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
The `keys()` function returns an array containing all keys of the given
dictionary value. The keys are sorted in declaration order.

-- Testcase --
{{ keys({ "foo": true, "bar": false, "qrx": 123 }) }}
-- End --

-- Expect stdout --
[ "foo", "bar", "qrx" ]
-- End --


If the given argument is not a dictionary, the function returns `null`.

-- Testcase --
{{ keys(true) === null }}
-- End --

-- Expect stdout --
true
-- End --