Untitled
unknown
plain_text
2 years ago
264 B
6
Indexable
type Obj = Record<string, string | number[]> type ToIds<T extends Obj> = { [K in keyof T]: T[K] extends string ? string : number; } const obj = { advisor: "Alert", cancel: "Button", option: [1,2], } type Test = ToIds<typeof obj>
Editor is loading...