logoalt Hacker News

antipuristtoday at 1:41 PM1 replyview on HN

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`.


Replies

phpnodetoday at 2:32 PM

yup, it's not possible to do it safely with a simple unparameterised type: https://www.typescriptlang.org/play/?#code/C4TwDgpgBAcg9gOwK...