#Convert object params array into an object preserving names

1 messages · Page 1 of 1 (latest)

ebon smeltBOT
#
freeaoi#0

Preview:```ts
const obj = {
a: {
b: {
c: "test",
},
},
history: {
hola: (username: string, id: string) =>
Hola ${username}!,
},
}

type FlattenObjectKeys<
T extends Record<string, unknown>,
Key = keyof T

= Key extends string
? T[Key] extends Record<string, unknown
...```

flint skiff
#

this isn't possible, unfortunately. parameter names/tuple labels are purely decorative and you can't work with them in the type system