Also speaking of hedge mazes, this took me a bit to figure out.  I think this may be a little clearer:

```js
if (manualDescEnd) {
  if (inclusiveEnd && doc.key < manualDescEnd) {
    return;
  } else if (!inclusiveEnd && doc.key <= manualDescEnd) {
    return;
  }
}
```