diff --git a/json2lua.js b/json2lua.js index 78be4a3..11d2a04 100644 --- a/json2lua.js +++ b/json2lua.js @@ -20,8 +20,10 @@ function jsonToLua(jsonObj, indent = '', linefeed = '\n') { if (typeof item === 'string') { luaStr += `${indent} '${item}',`; - } else { + } else if (typeof item == 'object') { luaStr += `{${jsonToLua(item, '', '')}},`; + } else { + luaStr += `${indent} ${item},`; } }); luaStr += `${indent}},\n`;