type-fest icon indicating copy to clipboard operation
type-fest copied to clipboard

KeysOfType

Open eklenin opened this issue 1 year ago • 3 comments

  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.
Fund with Polar

eklenin avatar Jun 05 '23 13:06 eklenin

The issue needs a description of the type and what problems it solves.

sindresorhus avatar Jun 05 '23 13:06 sindresorhus

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.

mwaibel-go avatar Sep 14 '23 08:09 mwaibel-go

Accepted

sindresorhus avatar Mar 08 '24 17:03 sindresorhus