joarwilk / flowgen

Generate flowtype definition files from TypeScript
Other
657 stars 87 forks source link

it generates incorrect syntax when parsing `Readonly<Record>` #200

Closed liamqma closed 1 year ago

liamqma commented 1 year ago

Input file:

function cssMap(): Readonly<Record<string, string>>;

generated file:

function cssMap(): Readonly<{[key: string]: string>}; // incorrect syntax

The correct one should be

function cssMap(): Readonly<{[key: string]: string}>;

The workaround is not using Readonly<Record>.

liamqma commented 1 year ago

Sorry, I cannot reproduce it anymore. It must be a mistake on my side.