Replace `case` with `if`/`else` to satisfy jshint.