From 150dfd214fba17f19ff37272403ecced31707d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20B=C4=99za?= Date: Fri, 14 Jul 2023 18:22:19 +0200 Subject: [PATCH] feat: add std.objectKeysValues and std.objectKeysValuesAll Upstream issue: https://github.com/google/go-jsonnet/pull/687 --- crates/jrsonnet-stdlib/src/std.jsonnet | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/jrsonnet-stdlib/src/std.jsonnet b/crates/jrsonnet-stdlib/src/std.jsonnet index 4d994499..1193ccd4 100644 --- a/crates/jrsonnet-stdlib/src/std.jsonnet +++ b/crates/jrsonnet-stdlib/src/std.jsonnet @@ -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]),