fix: expToLua convert null to nil

This commit is contained in:
Ching Pei Yang 2024-02-17 16:44:05 +01:00
parent 2b1749676d
commit 95566f10fb
No known key found for this signature in database
GPG key ID: 062FBBCE1D0C5DD9

View file

@ -19,6 +19,8 @@ in rec {
then lib.boolToString exp # if bool, convert to string then lib.boolToString exp # if bool, convert to string
else if builtins.isInt exp else if builtins.isInt exp
then builtins.toString exp # if int, convert to string then builtins.toString exp # if int, convert to string
else if exp == null
then "nil"
else (builtins.toJSON exp); # otherwise jsonify the value and print as is else (builtins.toJSON exp); # otherwise jsonify the value and print as is
# convert list to a lua table # convert list to a lua table