iterating through objects as key value pairs (cf. pythons .items())
Open
enhancement
stdlib
- Dominant language
- Jsonnet
- Stars
- 7.6k
- Forks
- 475
- PR merge metrics
- No merged PRs in 30d
Description
sometimes it's useful to process objects by iterating through the key value pairs
python has
```
obj = {"a": 1, "b": 2}
{k:v*2 for k,v in obj.items()}
```
jq has
```
echo '{"a": 1, "b": 2}'|jq '[to_entries[]|{key: .key, value: (.value * 2)}]|from_entries'
```
is there something similar in jsonnet? it seems like the list and object comprehensions could return (k,v) tuples if the right hand side is an object
Contributor guide
Assessment
This issue has not been assessed yet.