sindresorhus/type-fest

KeysOfType

Open

#630 opened on Jun 5, 2023

View on GitHub
 (3 comments) (2 reactions) (0 assignees)TypeScript (12,328 stars) (471 forks)batch import
help wantedtype addition

Description

  type KeysOfType<T, U> = {
    [K in keyof T]: T[K] extends U ? K : never;
  }[keyof T];

Contributor guide