typescript enum switch not working