leafo / tableshape

Test the shape or structure of a Lua table, inspired by React.PropTypes & LPeg
111 stars 9 forks source link

Print node description with tostring() #15

Closed sveyret closed 1 year ago

sveyret commented 2 years ago

Currently, nodes are printing their description in case of check failure. That would be good to be able to access this description at will, for example, overriding the __tostring() method of the types metatable, so that tostring(my_type) would display something more interesting than table <xxxxx>.

Thank you.

leafo commented 1 year ago

good suggestion, will be available in next release