|
|
|
|
|
by fishtoaster
1460 days ago
|
|
You can do some truly silly things with sufficiently ridiculous uses of typescript. I built a typecheck-time spell checker[0] in it such that: import { ValidWords } from "./spellcheck";
// Typechecks cleanly:
const result: ValidWords<"the quick brown fox."> = "valid";
// Throws a type error
const result: ValidWords<"the qxick brown fox."> = "valid";
[0] https://github.com/kkuchta/TSpell |
|
1: https://github.com/kkuchta/css-only-chat 2: https://github.com/kkuchta/tabdb