Language is not mentioned in a title, so my first thought was about TypeScript type wizardry. Turns out it's as simple as `Exclude<string, "">`.
https://www.typescriptlang.org/docs/handbook/utility-types.h...
Edit: nevermind, LLM fooled me.
It is very much mentioned in the article title and the first sentence. It's just HN that's truncated the title.
Speaking of TS, there's stuff in there for typing strings / string formats: https://www.typescriptlang.org/docs/handbook/2/template-lite...
Daily reminder that TypeScript's type checker is not sound.
https://www.typescriptlang.org/play/?#code/C4TwDgpgBAcg9gOwK...
It's simple, and it doesn't work as `Exclude` only applies to union types. For type `string` it just returns the same type `string`.