-
-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose KeysOfUnion type #709
Conversation
You need to add it to the readme too. |
Some more naming alternatives:
|
Hmm, we actually have a type for this already: type-fest/source/internal.d.ts Lines 40 to 47 in 47626cf
I think that name is the best. |
Interesting... Would it be okay to expose this internal type then? |
You can just replace the use of that type with yours (make sure you merge any docs/tests for it with yours). |
a52696c
to
b891b03
Compare
b891b03
to
c0d6a7d
Compare
Merged docs, replaced uses. |
Adds the
AllKeys
type, that is similiar tokeyof
but it distributes over unions, that is, it returns the keys of ALL members of a union type.Although this is a first step to add the types in #132, it is also useful by itself.
Additionally, I only used this name (
AllKeys
) because it's what was suggested in the issue I mentioned above, but there are other possible names we might want to consider, likeKeyOfDistributeUnions
orDistributedKeyOf
.