This is a small TypeScript repository for the web and node CLI to compare strings and determine if they are anagrams. There are also some basic Mocha tests in TS.
The sources and planning that went into this project are documented in SOURCES.MD.
ts-node ./src/main.ts [string1] [string2]
Example:
ts-node ./src/main.ts "this is a really long anagram" "this really long is a anagram"
The result is: ANAGRAM!
Run Mocha Tests:
npm test
Using the is Anagram function from src/variations
✔ Correctly determines an Anagram of hello
✔ Correctly determines an Anagram of testing
✔ Correctly determines an Anagram of trc aina
✔ Correctly determines an Anagram of number123
✔ Correctly determines an Anagram of along the riverways
✔ Correctly fails comparing two different strings
6 passing (5ms)
npm install
This project uses Parcel, which automatically transpiles the .ts files into JS.
The tsc command can be run to verify the integrity of the types, which are minimal in this small project.
run the server
npm run serve
Browse to localhost:1234
When you're ready to deploy, you can build for production with the following command:
npm run build