Skip to content

Type mismatch for jsonStructure.classes[].extends[] #27

@tokland

Description

@tokland

When parsing a ts file containing classes, the type of jsonStructure.classes[0].extends[0] is TypeModel:

https://github.com/SoftMediaLab/ts-structure-parser/blob/master/index.ts#L145

But on the generated JSON I see it's in a fact a BasicType, which has the fields I need, so I am forced to do a casting. That would not be necessary if TypeModel were converted to a discriminated union type.

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