I discovered a tool called pathmirror that transforms objects like:
{a: {b: null} }
to {a: {b: 'a.b'}
This is particularly useful for naming Redux actions.
I'm wondering how I can create a type definition for this?
Currently, my declaration looks like this:
declare module "pathmirror" {
export default function<T extends object>(value: T): {[key in keyof T]: object|string};
}
However, the object|string
part doesn't account for recursion.