Simplify expression

This commit is contained in:
Kevin R
2021-12-27 20:12:51 +01:00
parent 623067733a
commit 3b468fbdb7

View File

@@ -509,7 +509,7 @@ function start() {
* @param {String} method HTTP Method Name
*/
this.addMethod = function (method) {
if (methods.indexOf(method) == -1) {
if (methods.indexOf(method) === -1) {
methods.push(method);
}
}
@@ -517,12 +517,12 @@ function start() {
/**
* Check the requests' method.
*
* @param {requestDetails} details Requests deatils
* @returns {boolean} if need filter? true: false
* @param {requestDetails} details Requests details
* @returns {boolean} should be filtered or not
*/
this.matchMethod = function (details) {
if (!methods.length) return true;
return methods.indexOf(details['method']) > -1 ? true : false;
return methods.indexOf(details['method']) > -1;
}
/**
@@ -599,7 +599,7 @@ function start() {
* Function which called from the webRequest to
* remove the tracking fields from the url.
*
* @param {webRequest} request webRequest-Object
* @param {requestDetails} request webRequest-Object
* @return {Array} redirectUrl or none
*/
function clearUrl(request) {