0

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;
}
kitta
  • 1,723
  • 3
  • 23
  • 33

0 Answers0