Enjoy some TypeScript benefits without the drawbacks of
- Compilation time
- New language syntax
- Compile time only checks
With TypeCzech you can
- Check function parameter types, results, arrays, closures, and classes
- Ensure strings, arrays, and objects are not empty at run-time
- Catch malformed data from a fetch() call at run-time
- Specify run-time input validation constraints
- Detect run-time mutations in array and object function parameters
Missing from TypeCzech
- Type inference
- Checking types of optional function parameters
- Generics
TypeCzech the good parts
- Type signatures are plain JavaScript variables made of objects, arrays, and strings. No special type variables, no annotations, and no generics.
- Checking functions are easily detachable into a separate file. To stop all TypeCzech checking just stop importing the TypeCzech library in production or development. Decouple with a comment as in 03-Turn-Off-Library-Not-Loaded, a variable as in 102-Extending-Classes-Imports, or an if statement as in 204-Extending-Closures-Single.
- Does not introduce special syntax into your code, just plain functions. No .d.ts files just plain JavaScript.
TypeCzech the bad parts
- Verbosity of adding PRE_checking(), POST_checking(), and linkUp() functions to source
- Continuously checking parameter mutations of large collections can be slow
- When checking constructors and methods of extended classes, production code can get complicated if all TypeCzech testing code is to be completely removed for production.