Skip to content

Commit

Permalink
feat: add std.objectKeysValues and std.objectKeysValuesAll
Browse files Browse the repository at this point in the history
Upstream issue: google/go-jsonnet#687
  • Loading branch information
pawelbeza committed Jul 15, 2023
1 parent b9668b1 commit 150dfd2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/jrsonnet-stdlib/src/std.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@
objectValuesAll(o)::
[o[k] for k in std.objectFieldsAll(o)],

objectKeysValues(o)::
[{ key: k, value: o[k] } for k in std.objectFields(o)],

objectKeysValuesAll(o)::
[{ key: k, value: o[k] } for k in std.objectFieldsAll(o)],

resolvePath(f, r)::
local arr = std.split(f, '/');
std.join('/', std.makeArray(std.length(arr) - 1, function(i) arr[i]) + [r]),
Expand Down

0 comments on commit 150dfd2

Please sign in to comment.