Repository navigation
v2.4.0
What's New
- add
types.metatable_is(t)type constructor for testing the type of a table's metatable - add
types.cloneas a special type checker that will shallow clone an object via its transformation (that is valid to be cloned) - add
types.nullas an alias fornilchecker, so you can reference it without quoting it in Lua - add
__tostringmetamethod on all type objects. Converting a type object into a string will display its description
Bug Fixes
- MoonScript type checkers for instances no longer incorrectly return
truewhen passed class objects. They will only returntruewhen passed an appropriate instance of a MoonScript class is_typedoes not incorrectly returntruewhen passed a class object extended fromBaseType. It only returnstruewhen passed an instance of a type checker. For example, passing in a type constructortypes.is_type(types.shape)used to returntruebut now correctly returnsfalse. The result oftypes.is_type(types.shape({...})) will still correctly returntrue`
Misc
- Minor refactoring of internal code with regard to describing nodes
- Clarify many parts of the documentation regarding how state works
- Write clear example about transform and avoiding mutating objects
Full Changelog: v2.3.0...v2.4.0