getStage
may sometimes return undefined without reporting any errors, which could potentially lead to a code crash.
const a = Math.random() > 0.4
function getStage(): string {
if(a) {
return ''
}
}
const str: string = getStage()
after tsc compiled
var a = Math.random() > 0.4;
function getStage() {
if (a) {
return '';
}
}
var str = getStage();