TS TYPE GYMNASTICS ARENA
TS Type Arena: Type Gymnastics
Overcome the constraints of the TypeScript compiler by resolving three advanced typing puzzles (mapped types, conditionals, and key remapping).
TYPE CONSTRAINT
Create a custom version of the utility type 'Pick<T, K>'. Your type 'MyPick<T, K>' must accept an object type T and a union of keys K, extracting only the requested properties from T using mapped types and key constraints (extends keyof T).
Constraint Monitor
CONSTRAINT UNMETinterface User {
name: string;
age: number;
active: boolean;
}age: number;
active: boolean;
MyPick<User, "name" | "active">
✗ Type does not satisfy constraints or uses any/never
✗ Type does not satisfy constraints or uses any/nevertsc v5.4.5
Static TypeScript Compiler
Write valid type definitions to satisfy type assertions.
Loading editor…