-
-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Except is broken when used with generic property #232
Comments
I just noticed |
This sounds like a TS bug/limitation. Maybe open an issue about |
type IfPrimitiveString<C, T, F> = string extends C ? T : F;
type EqualsTest<T> = <A>() => A extends T ? 1 : 0;
type Equals<A1, A2> = EqualsTest<A2> extends EqualsTest<A1> ? 1 : 0;
type Filter<K, I> = Equals<K, I> extends 1 ? never : K;
type OmitIndex<T, I extends string | number> = {
[K in keyof T as Filter<K, I>]: T[K];
}; |
I just wanted to note that is |
Can we make a better |
We can, but under a different name. Some people want |
I'll do a PR. |
What would you name such a type? |
Maybe |
The problem reappeared in |
I don't see how that's possible. Nothing related to |
Playground link
The text was updated successfully, but these errors were encountered: