This is my class
class Game extends BaseModel {
@column({ isPrimary: true })
declare id: number
@column()
declare name: string
@column()
declare slug: string
}
I’m trying to build a parser to give me an end result like this
{
id: {
type: "string",
props: {
isPrimary: true
}
},
name: {
type: "string"
},
slug: {
type: "string"
},
}
The BaseModel provides a static map where I can find all the columns with the properties from the decorator. But I do not have the types
I haven’t found anything that I can use without instantiating the class with values. But I cannot do that because I’m trying to make this parser dynamic so it can handle any model I throw at it