From ec097bffde1185ee64cd84f4e756020ed86fbfb1 Mon Sep 17 00:00:00 2001 From: mikemfleming Date: Tue, 16 Apr 2019 12:48:28 -0500 Subject: [PATCH] swaps filter for reduce --- lib/http.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http.js b/lib/http.js index eab3f58..7391b15 100644 --- a/lib/http.js +++ b/lib/http.js @@ -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; }