diff --git a/json.lua b/json.lua index a3d7530..6c09c91 100644 --- a/json.lua +++ b/json.lua @@ -111,13 +111,17 @@ local function encode_number(val) return string.format("%.14g", val) end +local function encode_bool(val) + return tostring(val) +end + local type_func_map = { [ "nil" ] = encode_nil, [ "table" ] = encode_table, [ "string" ] = encode_string, [ "number" ] = encode_number, - [ "boolean" ] = tostring, + [ "boolean" ] = encode_bool, }