lua-cjson icon indicating copy to clipboard operation
lua-cjson copied to clipboard

Allows to encode empty tables as arrays.

Open ignacio opened this issue 12 years ago • 3 comments

An option is added to encode empty Lua tables to arrays. The option is encode_empty_table_as_array and is set like this:

   cjson.encode_empty_table_as_array("on")
   assert( cjson.encode{} == "[]" )

By default, the option is off.

This is the only commit that needs to be taken into consideration: https://github.com/ignacio/lua-cjson/commit/a6f950fa3b1f5d2b50a405cca5a74000dcf3dd16

The others correspond to other stuff.

ignacio avatar Apr 09 '13 20:04 ignacio

+ 1

tiemei avatar May 11 '13 07:05 tiemei

+1

kidd avatar Sep 05 '13 16:09 kidd

+ 1

deftonee avatar Apr 16 '24 17:04 deftonee