Home > Enterprise >  Passing string literals to index signatures
Passing string literals to index signatures

Time:10-11

I've currently got MyTest which simply maps over an object:

type MyTest<T> = {
  [P in keyof T]: T[P];
};

type Result = MyTest<{hello: 'world', foo: 2}>;
//   ^? type Result = { hello: 'world', foo: 2 }             
  • Related