4 ms·
You potentially get a problem for every '.' expression. In this code: import {Something} from './file'; console.log(Something.PROP); TypeScript doesn't kn
by russellsprouts 5y ago
You potentially get a problem for every '.' expression. In this code:
import {Something} from './file';
console.log(Something.PROP);
TypeScript doesn't know what to emit without type information. If Something is a class, then the JS will look the same. But if it's a const enum, then TypeScript has to erase the Something.PROP expression and replace it with the constant value of that enum member, since Something will not exist at runtime.