Skip to content

ModelToTypeScript: Breaks on object keys with spaces #29

@marcustyphoon

Description

@marcustyphoon

ModelToTypeScript doesn't appear to quote object keys that have spaces in them, resulting in SyntaxError: Property or signature expected (when Prettier tries to format the resulting code, I assume).

Easy to see in the workbench (select "typescript transform"):

https://sinclairzx81.github.io/typebox-workbench/?share=Ly8gRWRpdCBUeXBlU2NyaXB0IFR5cGVzIEhlcmUuIFVzZSBDdHJsICsgUyB0byBTaGFyZQoKZXhwb3J0IHR5cGUgVCA9IHsKICAnaGVsbG8gd29ybGQnOiBudW1iZXIKfQ%3D%3D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions