You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, I'd like to thank Kikito for producing this module. It's incredibly convenient for debugging, and it's literally invaluable to me in many cases (with metatables, or testing in restricted environments).
Currently the module outputs tables in this format:
Beyond the slight minification, the user could remove the brackets from the inspected table string. This produces a valid unpacked "array" (an arguments list!). So in a roundabout way, this could be useful for test units etc. (anything that needs to turn a static table into an arguments list).
Here's an example of this working well in the Chrome browser console (I feel JS shouldn't allow this kind of behaviour, but that's another story ;D).
The text was updated successfully, but these errors were encountered:
@kikito thoughts? Pinging in case this library was considered feature complete in 2017. I do understand if this kinda feature is impossible, or needs too much refactoring (if any is welcome at this point).
In Lua, "arrays" (called sequences) are defined as "not having holes" in Programming In Lua (I can't find the exact part now). The way I interpret this is that first nil, and everything after is is not part of the sequence. The library reflects this opinion.
Please feel free to add that feature to your own fork. I will not be implementing this feature.
Firstly, I'd like to thank Kikito for producing this module. It's incredibly convenient for debugging, and it's literally invaluable to me in many cases (with metatables, or testing in restricted environments).
Currently the module outputs tables in this format:
My suggestion is an option to display that table like this:
Maybe
options.array
conditional?Beyond the slight minification, the user could remove the brackets from the inspected table string. This produces a valid
unpack
ed "array" (an arguments list!). So in a roundabout way, this could be useful for test units etc. (anything that needs to turn a static table into an arguments list).Here's an example of this working well in the Chrome browser console (I feel JS shouldn't allow this kind of behaviour, but that's another story ;D).
The text was updated successfully, but these errors were encountered: