`_.contains($location.path(), pattern)` would be a little more declarative here.