Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1e3b0f5d0 | ||
|
|
69b714ad2b | ||
|
|
f049daf06c | ||
|
|
fd58f29876 | ||
|
|
d3f417d4d4 | ||
|
|
e1abe1c45c |
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2018 rxi
|
||||
Copyright (c) 2019 rxi
|
||||
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
|
||||
6
json.lua
6
json.lua
@@ -1,7 +1,7 @@
|
||||
--
|
||||
-- json.lua
|
||||
--
|
||||
-- Copyright (c) 2018 rxi
|
||||
-- Copyright (c) 2019 rxi
|
||||
--
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
-- this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -22,7 +22,7 @@
|
||||
-- SOFTWARE.
|
||||
--
|
||||
|
||||
local json = { _version = "0.1.1" }
|
||||
local json = { _version = "0.1.2" }
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Encode
|
||||
@@ -65,7 +65,7 @@ local function encode_table(val, stack)
|
||||
|
||||
stack[val] = true
|
||||
|
||||
if val[1] ~= nil or next(val) == nil then
|
||||
if rawget(val, 1) ~= nil or next(val) == nil then
|
||||
-- Treat as array -- check keys are valid and it is not sparse
|
||||
local n = 0
|
||||
for k in pairs(val) do
|
||||
|
||||
Reference in New Issue
Block a user