type-challenges / type-challenges

Collection of TypeScript type challenges with online judge

Home Page:https://tsch.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

62 - Type Lookup

Flavour86 opened this issue · comments

type LookUp<T extends Record<'type', string>, K> = T extends any
  ? T['type'] extends K
    ? T
    : never
  : never