Ugh, the typeof thing is ugly. How about
```
return if (words pattern || []).length > MAX_PATTERN_WORDS
```