Back to Chezmoi

`pruneEmptyDicts` *dict*

assets/chezmoi.io/docs/reference/templates/functions/pruneEmptyDicts.md

2.70.2307 B
Original Source

pruneEmptyDicts dict

pruneEmptyDicts modifies dict to remove nested empty dicts. Properties are pruned from the bottom up, so any nested dicts that themselves only contain empty dicts are pruned.

!!! example

```
{{ dict "key" "value" "inner" (dict) | pruneEmptyDicts | toJson }}
```