If you use a prefix, the prefix is prepended to map keys, including primitives.
type Example struct {
Variable map[string]string `json:"variable"`
}
func main() {
typescriptify.New().WithPrefix("Testing").Add(Example{}).ConvertToFile("./output.ts")
}
Will generate something like this:
export class TestingExample {
variable: {[key: Testingstring]: string};
}
It also affects all subtypes not specified. This could be desirable behavior but it may cause issues if the types are later or previously defined elsewhere.
If you use a prefix, the prefix is prepended to map keys, including primitives.
Will generate something like this:
It also affects all subtypes not specified. This could be desirable behavior but it may cause issues if the types are later or previously defined elsewhere.