-
-
Notifications
You must be signed in to change notification settings - Fork 557
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
Feature request: KeysMatching
(filtered keyof
)
#942
Labels
Comments
Could you include an example use-case (code)? |
const data = {
property: "123";
project: "abc";
topRegions: SomeComplexTypeA;
topContinents: SomeComplexTypeB;
topCountries: SomeComplexTypeC;
}
type Data = typeof data;
type Top = ValueOf<Data, KeysMatching<Data, `top${string}`>>;
// SomeComplexTypeA | SomeComplexTypeB | SomeComplexTypeC |
I could do a PR if you want |
fregante
changed the title
Feature request:
Feature request: Aug 22, 2024
KeysMatching
KeysMatching
(filtered keyof
)
I perfer split this to two type: |
Is this a duplicate of #630? (ignoring |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick way to get keys of an object matching a particular patterns, e.g. template literal types. Could be useful for composing with other util types like
ValueOf
.Upvote & Fund
The text was updated successfully, but these errors were encountered: