| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Co-Authored-By: Hisham Muhammad <hisham@gobolinux.org>
Co-authored-by: Mark Pulford <mark@kyne.com.au>
Co-authored-by: ichenq <ichenq@gmail.com>
Co-authored-by: Cloud Wu <cloudwu@gmail.com>
Co-authored-by: caijietao <t0350.prog@gmail.com>
Co-authored-by: actboy168 <actboy168@gmail.com>
Co-authored-by: wudeng <wudeng256@gmail.com>
Co-authored-by: caiyiheng <rangercyh@qq.com>
|
|
|
| |
Co-authored-by: Jesper Lundgren <jesperlundgren@exosite.com>
|
| |
|
|
|
|
| |
Thanks @spacewander for optimization and documentation.
|
|
|
|
|
|
|
| |
this can be turned on via cjson.decode_array_with_array_mt(true). off by
default.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
|
|
|
|
|
|
| |
encoding.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this fix, when the module would be loaded several times
(by-passing `package.loaded`), the `lua_cjson_new` function would
override the `empty_array_mt` table in the registry with a new one.
Comparison for equality between those tables would then fail, and the
behavior would be broken.
This was discovered after loading `cjson` *and* `cjson.safe` in the same
application, resulting in two calls to `lua_cjson_new`.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A proposed improved patch of openresty/lua-cjson#1 (a patch commonly
proposed to lua-cjson and its forks), taking into considerations
comments from the original PR.
- use a lightuserdata key to store the metatable in the Lua Registry
(more efficient and avoiding conflicts)
- provide a lightuserdata resulting in empty arrays as well
- tests cases moved to t/agentzh.t, where cases for
'encode_empty_table_as_object' are already written. It seems like a
better place for tests specific to the OpenResty fork's additions.
- a more complex test case
|
|
|
|
|
|
|
|
| |
cjson.encode_number_precision().
thanks lordnynex for the patch in #4.
Test cases for changing precision
|
| |
|
|
encode_empty_table_as_object so that we can encode empty Lua tables into empty JSON arrays.
|