Created
October 31, 2021 12:53
-
-
Save jjo/58163b71b24991b1b3c9bad7516f35e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ /tmp cat > foo.jsonnet | |
local applyModifications(obj, f) = | |
obj + { | |
[x] : f(obj[x]) for x in std.objectFieldsAll(obj) | |
} | |
; | |
applyModifications({ | |
visible: "foo", | |
hidden:: "bar", | |
}, function(x) x + " modified") | |
$ /tmp jsonnet foo.jsonnet | |
{ | |
"hidden": "bar modified", | |
"visible": "foo modified" | |
} | |
$ /tmp jsonnet --version | |
Jsonnet commandline interpreter v0.17.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment