Rewrites every non-erasable construct in a generated file so it compiles under erasableSyntaxOnly and runs under Node.js type stripping.
erasableSyntaxOnly
The contents of a single generated file.
The same file with only erasable TypeScript syntax.
makeSyntaxErasable("export enum Key {\n V1,\n V2,\n}");// const KeyLookup = { 0: "V1", 1: "V2", V1: 0, V2: 1 } as const;//// export const Key: Omit<typeof KeyLookup, number> = KeyLookup;//// export type Key = (typeof Key)[keyof typeof Key]; Copy
makeSyntaxErasable("export enum Key {\n V1,\n V2,\n}");// const KeyLookup = { 0: "V1", 1: "V2", V1: 0, V2: 1 } as const;//// export const Key: Omit<typeof KeyLookup, number> = KeyLookup;//// export type Key = (typeof Key)[keyof typeof Key];
Rewrites every non-erasable construct in a generated file so it compiles under
erasableSyntaxOnlyand runs under Node.js type stripping.