Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 1.37 KB

File metadata and controls

20 lines (13 loc) · 1.37 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