Skip to content

Unexpected token during transformation #64

Open

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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