[Typescript] Remove one element from unit type

export type Letter = 'a' | 'b' | 'c'
type RemoveC<TType> = TType extends 'c' ? never: TType;
type WithoutC = RemoveC<Letter>;

posted @ 2022-04-25 14:48  Zhentiw  阅读(29)  评论(0编辑  收藏  举报