luci-lib-jsonc: allow encoding empty lists
luci-lib-jsonc: allow encoding empty lists

To be consistent with the behavior of luci-lib-json, an empty Lua table
should be encoded to an empty JSON list, not an empty JSON object.

To still allow encoding empty JSON objects, the usage of anything other
than a number or a string as a key (for example an empty table or a
function) can be used to force encoding as an object:

    json.stringify({})                  -- "[]"
    json.stringify({[{}] = true})       -- "{}"

Signed-off-by: Jan-Philipp Litza <e822b5b0d8860d776ffe82d0ccfbc6fda0a55491@litza.de>

openwrt-es/openwrt-luci,obsy/luci,jchuang1977/luci-1,tobiaswaldvogel/luci,tobiaswaldvogel/luci,aa65535/luci,rogerpueyo/luci,lbthomsen/openwrt-luci,cappiewu/luci,lbthomsen/openwrt-luci,remakeelectric/luci,artynet/luci,marcel-sch/luci,jorgifumi/luci,shangjiyu/luci-with-extra,hnyman/luci,LuttyYang/luci,ollie27/openwrt_luci,mumuqz/luci,schidler/ionic-luci,LuttyYang/luci,obsy/luci,nmav/luci,kuoruan/luci,wongsyrone/luci-1,artynet/luci,thess/OpenWrt-luci,mumuqz/luci,rogerpueyo/luci,tobiaswaldvogel/luci,cappiewu/luci,bittorf/luci,oneru/luci,urueedi/luci,chris5560/openwrt-luci,urueedi/luci,ollie27/openwrt_luci,nmav/luci,openwrt/luci,thess/OpenWrt-luci,Noltari/luci,shangjiyu/luci-with-extra,LuttyYang/luci,teslamint/luci,jorgifumi/luci,LuttyYang/luci,maxrio/luci981213,shangjiyu/luci-with-extra,chris5560/openwrt-luci,thesabbir/luci,Noltari/luci,chris5560/openwrt-luci,daofeng2015/luci,forward619/luci,mumuqz/luci,obsy/luci,MinFu/luci,wongsyrone/luci-1,cshore-firmware/openwrt-luci,daofeng2015/luci,oneru/luci,cshore-firmware/openwrt-luci,981213/luci-1,jchuang1977/luci-1,cshore/luci,remakeelectric/luci,chris5560/openwrt-luci,aa65535/luci,dwmw2/luci,maxrio/luci981213,taiha/luci,daofeng2015/luci,bright-things/ionic-luci,kuoruan/luci,cappiewu/luci,openwrt-es/openwrt-luci,ollie27/openwrt_luci,artynet/luci,981213/luci-1,Hostle/luci,cshore-firmware/openwrt-luci,schidler/ionic-luci,jlopenwrtluci/luci,marcel-sch/luci,NeoRaider/luci,oneru/luci,marcel-sch/luci,jorgifumi/luci,cappiewu/luci,cshore-firmware/openwrt-luci,taiha/luci,bright-things/ionic-luci,openwrt/luci,MinFu/luci,kuoruan/luci,taiha/luci,kuoruan/lede-luci,daofeng2015/luci,wongsyrone/luci-1,jchuang1977/luci-1,teslamint/luci,urueedi/luci,Hostle/luci,remakeelectric/luci,hnyman/luci,forward619/luci,thess/OpenWrt-luci,Noltari/luci,teslamint/luci,teslamint/luci,NeoRaider/luci,kuoruan/lede-luci,nmav/luci,981213/luci-1,mumuqz/luci,MinFu/luci,kuoruan/lede-luci,oneru/luci,Hostle/luci,artynet/luci,cshore/luci,jlopenwrtluci/luci,shangjiyu/luci-with-extra,thesabbir/luci,cappiewu/luci,marcel-sch/luci,cshore/luci,lbthomsen/openwrt-luci,ollie27/openwrt_luci,openwrt-es/openwrt-luci,shangjiyu/luci-with-extra,thesabbir/luci,lbthomsen/openwrt-luci,Hostle/luci,openwrt-es/openwrt-luci,981213/luci-1,aa65535/luci,kuoruan/lede-luci,obsy/luci,schidler/ionic-luci,Wedmer/luci,981213/luci-1,remakeelectric/luci,nmav/luci,bittorf/luci,taiha/luci,MinFu/luci,forward619/luci,tobiaswaldvogel/luci,oneru/luci,kuoruan/luci,remakeelectric/luci,schidler/ionic-luci,shangjiyu/luci-with-extra,shangjiyu/luci-with-extra,rogerpueyo/luci,artynet/luci,daofeng2015/luci,maxrio/luci981213,aa65535/luci,thesabbir/luci,cshore-firmware/openwrt-luci,dwmw2/luci,hnyman/luci,cshore/luci,jorgifumi/luci,jlopenwrtluci/luci,kuoruan/lede-luci,oneru/luci,openwrt/luci,hnyman/luci,marcel-sch/luci,kuoruan/lede-luci,dwmw2/luci,cshore-firmware/openwrt-luci,daofeng2015/luci,Wedmer/luci,wongsyrone/luci-1,Wedmer/luci,dwmw2/luci,oneru/luci,kuoruan/luci,bittorf/luci,tobiaswaldvogel/luci,hnyman/luci,Hostle/luci,jorgifumi/luci,ollie27/openwrt_luci,jchuang1977/luci-1,thesabbir/luci,LuttyYang/luci,cshore-firmware/openwrt-luci,tobiaswaldvogel/luci,maxrio/luci981213,openwrt-es/openwrt-luci,urueedi/luci,chris5560/openwrt-luci,obsy/luci,taiha/luci,taiha/luci,bittorf/luci,cshore/luci,lbthomsen/openwrt-luci,kuoruan/lede-luci,teslamint/luci,aa65535/luci,jorgifumi/luci,Hostle/luci,Noltari/luci,rogerpueyo/luci,cappiewu/luci,bittorf/luci,jchuang1977/luci-1,forward619/luci,Wedmer/luci,kuoruan/luci,openwrt/luci,kuoruan/luci,LuttyYang/luci,Hostle/luci,forward619/luci,bright-things/ionic-luci,teslamint/luci,thess/OpenWrt-luci,mumuqz/luci,MinFu/luci,jlopenwrtluci/luci,wongsyrone/luci-1,hnyman/luci,kuoruan/luci,thesabbir/luci,nmav/luci,maxrio/luci981213,artynet/luci,MinFu/luci,maxrio/luci981213,schidler/ionic-luci,Wedmer/luci,981213/luci-1,urueedi/luci,schidler/ionic-luci,jlopenwrtluci/luci,rogerpueyo/luci,LuttyYang/luci,taiha/luci,openwrt/luci,dwmw2/luci,Noltari/luci,artynet/luci,lbthomsen/openwrt-luci,marcel-sch/luci,obsy/luci,mumuqz/luci,cappiewu/luci,nmav/luci,NeoRaider/luci,openwrt-es/openwrt-luci,aa65535/luci,thess/OpenWrt-luci,bittorf/luci,openwrt/luci,openwrt/luci,Noltari/luci,urueedi/luci,hnyman/luci,jchuang1977/luci-1,Wedmer/luci,taiha/luci,jchuang1977/luci-1,wongsyrone/luci-1,mumuqz/luci,forward619/luci,jlopenwrtluci/luci,wongsyrone/luci-1,forward619/luci,urueedi/luci,rogerpueyo/luci,aa65535/luci,schidler/ionic-luci,jchuang1977/luci-1,bright-things/ionic-luci,jlopenwrtluci/luci,ollie27/openwrt_luci,bittorf/luci,981213/luci-1,remakeelectric/luci,marcel-sch/luci,ollie27/openwrt_luci,hnyman/luci,chris5560/openwrt-luci,bright-things/ionic-luci,forward619/luci,tobiaswaldvogel/luci,nmav/luci,artynet/luci,bright-things/ionic-luci,artynet/luci,Wedmer/luci,Noltari/luci,lbthomsen/openwrt-luci,MinFu/luci,remakeelectric/luci,teslamint/luci,thess/OpenWrt-luci,openwrt-es/openwrt-luci,MinFu/luci,rogerpueyo/luci,cshore/luci,urueedi/luci,dwmw2/luci,lbthomsen/openwrt-luci,obsy/luci,daofeng2015/luci,chris5560/openwrt-luci,Noltari/luci,openwrt-es/openwrt-luci,bright-things/ionic-luci,teslamint/luci,jlopenwrtluci/luci,nmav/luci,bright-things/ionic-luci,NeoRaider/luci,dwmw2/luci,thesabbir/luci,openwrt/luci,nmav/luci,oneru/luci,schidler/ionic-luci,cshore/luci,dwmw2/luci,remakeelectric/luci,Hostle/luci,aa65535/luci,LuttyYang/luci,cshore-firmware/openwrt-luci,chris5560/openwrt-luci,thess/OpenWrt-luci,jorgifumi/luci,cshore/luci,kuoruan/lede-luci,tobiaswaldvogel/luci,NeoRaider/luci,rogerpueyo/luci,bittorf/luci,cappiewu/luci,NeoRaider/luci,obsy/luci,marcel-sch/luci,ollie27/openwrt_luci,maxrio/luci981213,mumuqz/luci,wongsyrone/luci-1,Noltari/luci,NeoRaider/luci,NeoRaider/luci,jorgifumi/luci,Wedmer/luci,maxrio/luci981213,thess/OpenWrt-luci,daofeng2015/luci,thesabbir/luci,shangjiyu/luci-with-extra