Minor optimization

Move loop invariant code.
```js
excludes = Array.isArray(excludes) || [];
```