google / google/jsonnet

Stdlib function for making an object selfless (replace all fields with concrete values).

Open
#835 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.