Perhaps both ifs can be joined to one
```
if (canAggregateOperation(operation) && recentOperations.some(isEditOperation))
```
Only one level of branching would minimally improve readability