Skip to main content

Hidash

A Learning TypeScript > Generics 🥗 appetizer project.

Zap! Bang! Fizz!

Welcome, traveler, to the mystical world of... 2010! But it's not the 2010 you're thinking of. You've entered a parallel universe eerily similar to yours but for two key differences:

  • Lodash was never released
  • TypeScript was released much earlier, in the early 2000s

Your task is to create several Lodash-like useful array and object functions in TypeScript. They will need to use generic type arguments for proper typings.

Welcome to the TypeScript Zone.

Setup

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

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

Change your terminal directory to this project's:

cd projects/generics/hidash

In one terminal, start the TypeScript compiler in watch mode:

tsc --watch

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

npm test -- 1 --watch

Steps

Notes

  • Don't import code from one step into another.
  • Each function you write will need to use generic type arguments to be properly typed.