Files
cats.ts
What you'll learn
- Write union and literal types that allow exactly the values that make sense
- Narrow unknown with typeof, equality, Array.isArray and in, and write a type predicate
- Model a result that is one of two shapes as a discriminated union, and narrow on its tag
Press Run tests to start the app. Its log appears here.Tests
- cats.spec.tsrun to see its tests