This commit is contained in:
Josh Robson Chase 2024-05-01 13:51:08 +02:00 committed by GitHub
commit 4986092ba0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 16 deletions

View File

@ -111,10 +111,8 @@
in "${name} ${concatStringsSep " " flatElements}";
# String -> ListOf Anything -> String
convertListOfNonFlatAttrsToKDL = name: list: ''
${name} {
${indentStrings (map (x: convertAttributeToKDL "-" x) list)}
}'';
convertListOfNonFlatAttrsToKDL = name: list:
"${concatStringsSep "\n" (map (x: convertAttributeToKDL name x) list)}";
# String -> ListOf Anything -> String
convertListToKDL = name: list:

View File

@ -27,15 +27,11 @@ listInAttrsInList {
}
}
list2 {
- {
a 8
}
a 8
}
}
nested {
- 1 2
- true false
-
- null
}
repeated 1 2
repeated true false
repeated
repeated null
unsafeString " \" \n "

View File

@ -20,7 +20,7 @@
''
null
];
nested = [ [ 1 2 ] [ true false ] [ ] [ null ] ];
repeated = [ [ 1 2 ] [ true false ] [ ] [ null ] ];
extraAttrs = {
_args = [ 2 true ];
_props = {
@ -33,12 +33,12 @@
};
};
listInAttrsInList = {
list1 = [
list1."-" = [
{ a = 1; }
{ b = true; }
{
c = null;
d = [{ e = "asdfadfasdfasdf"; }];
d."-" = [{ e = "asdfadfasdfasdf"; }];
}
];
list2 = [{ a = 8; }];