Ah! Thanks for pointing this out, I'll be sure update the post. (I haven't used TypeScript all that extensively, so I didn't even know about `const enum`.)
https://www.typescriptlang.org/play/#src=const%20enum%20Scre...
This is what uglify makes of that:
var needsCancelButton = function (e) {
switch (e) {
case 0:
case 1:
return!0;
case 2:
return!1
}
return e
};
EDIT: Just using `return screen` without the reassignment also works because the return type of the function and the type of the argument are incompatible, but that seems a lot more error prone and less widely applicable that explicitly reassigning to a `never` variable and returning that.