Is it possible to generate the Json object from interfaces populated with the key type in string? See below the interface example:
export interface shop {
refNo: Number
domain?: string[],
details: {
name? : string,
cui : string,
contact?: {
name?: string,
phone?: string
}[]
}
This should be the result:
let shopObj = {
refNo: "Number"
domain?: ["string"], // "Array String"
details: {
name? : "string",
cui : "string",
contact?: [{
name?: "string",
phone?: "string"
}]
}
}
are there any utilities that do this, does anyone have any idea how this transformation can be done from the interface?