helpers: fix toLuaObject ignoring empty objects (#213)

This commit is contained in:
Pedro Alves 2023-02-28 18:20:13 +00:00 committed by GitHub
parent 0620ffc889
commit 92867386c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ with lib; rec {
if head (stringToCharacters n) == "@"
then toLuaObject v
else "[${toLuaObject n}] = " + (toLuaObject v))
(filterAttrs (n: v: !isNull v && toLuaObject v != "{}") args)))
(filterAttrs (n: v: !isNull v) args)))
+ "}"
else if builtins.isList args
then "{" + concatMapStringsSep "," toLuaObject args + "}"