Secret Secrets
A Learning TypeScript > Functions 🥗 appetizer project. You'll practice writing functions with parameter and return type annotations.
"Secret secrets are no fun. Secret secrets hurt someone." A wise nurse once told me that. And yet, in my business as the best top-secret agent in the business, secret secrets are sine qua nons.
We believe our rival -the dastardly Goldberger- has been spying on our messages. Your mission, should you choose to accept it, is to aide me in creating TypeScript functions for text encoding and secret management. Are you up to the task, recruit?
Setup
If you haven't yet, set up the github.com/LearningTypeScript/projects repository locally.
shellgit clone https://github.com/LearningTypeScript/projects learning-typescript-projectscd learning-typescript-projectsnpm i
shellgit clone https://github.com/LearningTypeScript/projects learning-typescript-projectscd learning-typescript-projectsnpm i
Open your editor in this project's directory:
shellcode projects/functions/secret-secrets
shellcode projects/functions/secret-secrets
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:
shellnpm run tsc -- --project 01-incoming-cipher --watch
shellnpm run tsc -- --project 01-incoming-cipher --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:
shellnpm run test -- 1 --watch
shellnpm run test -- 1 --watch
Note: your terminal should be in the
secret-secretsdirectory, not the root repository's directory.
Steps
Notes
- Please solve these with
forloops, not fancy.map/.reduceshenanigans or with npm libraries.- For bonus points, you can try making versions of all the steps that only use array methods instead of
forloops!
- For bonus points, you can try making versions of all the steps that only use array methods instead of
- Don't import code from one step into another.