Skip to content

Commit

Permalink
swaps filter for reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemfleming committed Apr 16, 2019
1 parent 3f3486d commit ec097bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ module.exports = function (chai, _) {
var hasRedirected;

if (Object.prototype.toString.call(destination) === '[object RegExp]') {
hasRedirected = redirects.filter(redirect => destination.test(redirect)).length > 0;
hasRedirected = redirects.reduce((flag, redirect) => flag || destination.test(redirect), false);
} else {
hasRedirected = redirects.indexOf(destination) > -1;
}
Expand Down

0 comments on commit ec097bf

Please sign in to comment.