Stdlib function for making an object selfless (replace all fields with concrete values).
Open
stdlib
- Dominant language
- Jsonnet
- Stars
- 7.6k
- Forks
- 475
- PR merge metrics
- No merged PRs in 30d
Description
Probably not so useful for real world stuff, but it would be useful for explaining the inheritance model and maybe for debugging.
Not sure what the right name for that would be. I'll use `concretize` for now.
It can be implemented more or less like the following:
```
local concretize(obj) = { [f]: obj.f for f in std.objectFields(obj) } + { [f]:: obj.f for f in std.objectFieldsAll(obj) if !std.objectHas(obj, f) }
```
Contributor guide
Assessment
This issue has not been assessed yet.