Simplify expression

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

View File

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