Skip to content

Unexpected token during transformation #64

@madbence

Description

@madbence

Compiling the following type results in a syntax error:

Codegen.TypeScriptToModel.Generate(`export type T = [string, ...string[]]`);

The thrown error:

    ...Type.Rest(string[])
                        ^

SyntaxError: Unexpected token ']'

The TypeScript type is also a generated one (from JSON schema, where the compiler defines a list with minItems: 1 like this), so I can probably find a workaround by relaxing the JSON schema.

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