Skip to main content

Prickly Predicates

A Learning TypeScript > Type Modifiers πŸ₯— appetizer project.

Howdy ho, farmer friend!

Here at 🌡 Cultured Cacti 🌡, we cultivate the crème de la crème of cactus, cassava, and chia. Any plant that reminds you of savannahs, South America, and the American Southwest are our claim to fame. Yee-haw!

We reckon our industry could be much improved by some spring cleaning of our code. We'd like to prepare a trio of TypeScript type predicates to wrangle our unruly data types. Are you up for the challenge, partner?

Setup​

If you haven't yet, set up the github.com/LearningTypeScript/projects repository locally.

shell
git clone https://github.com/LearningTypeScript/projects learning-typescript-projects
cd learning-typescript-projects
npm i
shell
git clone https://github.com/LearningTypeScript/projects learning-typescript-projects
cd learning-typescript-projects
npm i

Open your editor in this project's directory:

shell
code projects/type-modifiers/prickly-predicates
shell
code projects/type-modifiers/prickly-predicates

In one terminal, run the TypeScript compiler via the tsc script within whichever step you're working on. For example, to start the TypeScript compiler on the first step in watch mode:

shell
npm run tsc -- --project 01-pruning-pests --watch
shell
npm run tsc -- --project 01-pruning-pests --watch

In another terminal, run Jest via the test script on whichever step you're working on. For example, to start tests for the first step in watch mode:

shell
npm run test -- 1 --watch
shell
npm run test -- 1 --watch

Note: your terminal should be in the prickly-predicates directory, not the root repository's directory.

Steps​

Notes​