json-schema-to-typescript
json-schema-to-typescript copied to clipboard
Fix strictIndexSignature with standalone types
Removes the safe-naming reapplication against generateType return values
which might cause invalid typescript definition files when strictIndexSignature is used.
interface MyInterface {
- [k: string]: LeafUndefined; // error TS2304: Cannot find name 'LeafUndefined'.
+ [k: string]: Leaf | undefined;
}
Please let me know if you think a different codepath needs to be fixed.
But to me it looks like generateType calls generateRawType which already has:
if (hasStandaloneName(ast)) {
return toSafeString(ast.standaloneName)
}