type-fest
type-fest copied to clipboard
KeysOfType
type KeysOfType<T, U> = {
[K in keyof T]: T[K] extends U ? K : never;
}[keyof T];
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- The funding will be given to active contributors.
- Thank you in advance for helping prioritize & fund our backlog.
The issue needs a description of the type and what problems it solves.
This is the userland implementation of https://github.com/microsoft/TypeScript/issues/48992 mentioned in the issue description. While it’s not implemented in TypeScript, I’d appreciate it being here.
Accepted