refactor mapAttrsRecursiveCond
This commit is contained in:
parent
7aa75affdb
commit
106d9a51a5
1 changed files with 5 additions and 3 deletions
|
|
@ -79,10 +79,12 @@ with builtins; rec {
|
|||
mapAttrsRecursiveCond = cond: f: set: let
|
||||
recurse = path:
|
||||
mapAttrs (
|
||||
name: value:
|
||||
name: value: let
|
||||
next = path ++ [name];
|
||||
in
|
||||
if isAttrs value && cond value
|
||||
then recurse (path ++ [name]) value
|
||||
else f (path ++ [name]) value
|
||||
then recurse next value
|
||||
else f next value
|
||||
);
|
||||
in
|
||||
recurse [] set;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue