This makes it closer to what can be done with plain Lua tables (it is also interesting to convert JSON -> tds, even though the special case of JSON null is not covered out-of-the-box).
Prior to this PR, true was clearly stated as unsupported, but false had side effects (it removed the entry for a hash, and was stored as a nil element for a vec).
Last: I made the choice to write tests like if lval or type(lval) == 'boolean' then instead of if type(lval) ~= 'nil' then (more readable) to take benefit of short-circuit evaluations, i.e. type() is called only for nil and false values.
This makes it closer to what can be done with plain Lua tables (it is also interesting to convert JSON -> tds, even though the special case of JSON
null
is not covered out-of-the-box).Prior to this PR,
true
was clearly stated as unsupported, butfalse
had side effects (it removed the entry for a hash, and was stored as a nil element for a vec).Last: I made the choice to write tests like
if lval or type(lval) == 'boolean' then
instead ofif type(lval) ~= 'nil' then
(more readable) to take benefit of short-circuit evaluations, i.e.type()
is called only fornil
andfalse
values.