JavaScript, Typescript switch statement: way to run same code for two cases?