Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to force to encode empty table to "[]" #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 16, 2015

  1. option to force to encode empty table to "[]"

    Since lua-cjson use table index type to decide what type a lua table is
    encoded to, there is no way to encode empty lua type to list.
    
    This patch solves this problem by assigning a special meta-table to an
    empty table to force it to be encoded to "[]" instead of "{}":
    
        setmetatable({},cjson.as_array)
    drmingdrmer committed Jul 16, 2015
    Configuration menu
    Copy the full SHA
    3b1429f View commit details
    Browse the repository at this point in the history