Given this type in Typescript
type MyType = {
name: string;
gender?: "male" | "female";
section: {
a: string;
b: string;
};
}
Hot to transform the type into flatted version like so?
{
name: string;
gender?: "male" | "female";
"section.a": string;
"section.b": string;
}