3 ms·
So does spellcheck contain a gigantic array of the English language?
by idontwantthis 4y ago
So does spellcheck contain a gigantic array of the English language?
- jjtheblunt 4y agothe source code to answer your question is directly above your question
- KMag 4y agoI'm inclined to cut someone a bit of slack for not following the link to the implementation if the context suggests deeply nested template meta programming golf is involved. It's surprisingly much less complicated than I would have expected.
- xdennis 4y agoYes. It looks like this: export type ValidWords<T extends string> = T extends "" ? "valid" : T extends `the${infer Rest}` | `of${infer Rest}` | `and${infer Rest}` | ...