What about rewriting this as an if-statement:
```js
if (number > 8 || number < -8)
  number = number % 7 || number > 0 ? 7 : -7
```