mpx / lua-cjson

Lua CJSON is a fast JSON encoding/parsing module for Lua
https://kyne.au/~mark/software/lua-cjson.php
MIT License
936 stars 478 forks source link

encode/decode array with special metatable #85

Closed StarlightIbuki closed 1 year ago

StarlightIbuki commented 1 year ago

We cannot tell empty lua tables from arrays. This PR tries to introduce a solution, to add a metatable to decoded array; and we encode table with this metatable as array.

This feature can also cooperate with: https://github.com/starwing/lua-protobuf/pull/240

StarlightIbuki commented 1 year ago

Close as we prefer another solution.