Objects.PathTypeMap feature request
jessekelly881 opened this issue · comments
Something like this would be useful to be able to get the type at a given path, if possible.
/*
* { "a": { b: number }, "a.b": number }
*/
type Ret = Objects.PathTypeMap<{ a: { b: number } }>
we have this :
type Res = $<Objects.Get, "a.b", { a: { b: number } } >;
// ^? type Res = number
and this :
type Res = $<Objects.AllPaths, { a: { b: number } }>
// ^? type Res = "a.b"
so you can combine both ?
Ooh. I overlooked Object.Get. That works. Thanks!