All notable changes to this project will be documented in this file.
toTypeString
has been renamed totypeToString
.simpleTypeToString
is no longer exported.spread
onSimpleTypeFunctionParameter
has been renamed torest
.hasRestElement
onSimpleTypeTuple
has been renamed torest
.SimpleTypeKind
andSimpleTypeModifierKind
have been converted to string literal unions..methods
andproperties
onSimpleTypeClass
have been renamed tomembers
.argTypes
onSimpleTypeFunction
andSimpleTypeMethod
have been renamed toparameters
.CIRCULAR_REF
SimpleType has been removed.SimpleTypeFunctionArgument
has been renamed toSimpleTypeFunctionParameter
.
- Added support for "Object", "Number", "Boolean", "BigInt", "String".
- Improved type checking support for intersection types.
- Fixed type checking of function type rest parameters.
optional
is now added properly to class members.- Improved type checking of functions/methods.
- Improved type checking of class/interface/object.
- Type parameters now default to
unknown
instead ofany
. - Members with call signatures are now
methods
instead offunctions
.
- All
SimpleType
's are now lazy per default. Types will evaluate when interacting with the object. This behavior can be overwritten with{eager: true}
. - Added helper functions to serialize and deserialize types making it possible to store types with circular references.
- Added new SimpleTypeKind "NON_PRIMITIVE" representing the non-primitive type:
object
. - Added new SimpleTypeKidn "ES_SYMBOL" and "ES_SYMBOL_UNIQUE" representing the
Symbol
type. - Added support for type checking constructors and call signatures on object types.
- Added
validateType
function that makes it possible easily make custom validator functions withSimpleType
. - The results of converting Type to SimpleType are now always cached and used whenever calling
toSimpleType
. It's possible to supply this function with your own cache. - The results of checking type assignability are now always cached and used whenever calling
isAssignableToType
. It's possible to supply this function with your own cache. - Added
serializeSimpleType
anddeserializeSimpleType
functions. - All members of
SimpleType
are nowreadonly
. - If two
ts.Type
values are given toisAssignableToType
, the function will prioritize testing usingisTypeAssignableTo
on the type checker if it has been exposed.
- Updated all dependencies.
- Cleaned up project structure.
- Added script to quickly test and debug assignability (
npm run playground
).
- Fix breaking API changes in Typescript 3.7 (741c837e)
- Relax check in extendTypeParameterMap (f5da8437)
- Add 'void' to 'PRIMITIVE_TYPE_KINDS' because it represents 'undefined' (ad5c7bcf)
0.3.6 (2019-08-17)
- Make it possible to overwrite type checking logic by running user defined code when comparing types (5a5e376)
0.3.5 (2019-07-16)
- Check in rollup.config.js. This fixes #6 (5fcb5cc)
- Fix multiple failing assignability checks when comparing tuples, intersections, never and object types (b1b06c0)
- Fix some failing tests when comparing recursive types and object assignability with zero properties in common (11ca879)
- Fix tuple and intersection checking (95bdcdb)
- Fix typo 'SimpleTyoeCircularRef'. This closes #7 (5b73bf1)
0.3.3 (2019-05-02)
0.3.2 (2019-04-26)
0.3.1 (2019-04-25)
- Fix generic type recursion (e65b106)
- Add support for intersection types and never types (f7d531b)
0.3.0 (2019-04-23)
- Add support for intersection types and never types (f7d531b)
- Add support for strict null checks (19fce94)
0.2.28 (2019-04-08)
- ArrayLike and PromiseLike (6d51122)
- Fix various function checks and add more function related test cases (cd8c1c5)
0.2.27 (2019-03-07)
- Fix problem where isAssignableToSimpleTypeKind wouldn't match ANY (7edd4b3)
0.2.26 (2019-03-07)
- isAssignableToSimpleTypeKind now treats kind OBJECT without members as kind ANY (b75ff9a)
0.2.25 (2019-02-25)
0.2.24 (2019-02-25)
- Allow assigning anything but 'null' and 'undefined' to the type '{}' (5f0b097)
0.2.23 (2019-02-15)
- Issue where isAssignableToSimpleTypeKind would fail with type 'ANY' (38d7743)
0.2.22 (2019-02-15)
0.2.21 (2019-02-15)
- Add function that can return the string representation of either a native typescript type or a simple type (2019248)
0.2.20 (2019-02-12)
- Fix problem where recursive types created from the cache would crash the type checking (b62167a)
0.2.19 (2019-02-11)
- Add 'Date' type for performance gains. (a8c74de)
0.2.18 (2019-02-10)
- Add ALIAS, GENERIC and PROMISE types. Refactor and improve type checking logic especially for very complex types. (e1e636c)
0.2.17 (2019-01-15)
- Fix function that checks if input to functions is node or type (3eafb07)
- Add support for circular referenced types (90ba8f5)
- Add support for circular referenced types (90ba8f5)