Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 1.64 KB

File metadata and controls

20 lines (13 loc) · 1.64 KB

ObjectFromEntries hard #object

by jiangshan @jiangshanmeta

Take the Challenge

Implement the type version of Object.fromEntries

For example:

interface Model {
  name: string;
  age: number;
  locations: string[] | null;
}

type ModelEntries = ['name', string] | ['age', number] | ['locations', string[] | null];

type result = ObjectFromEntries<ModelEntries> // expected to be Model

Back Share your Solutions Check out Solutions

Related Challenges

55・Union to Intersection