Avoid calling Object.prototype methods directly on object instances

This commit is contained in:
Daniel García Aubert
2019-10-21 23:33:27 +02:00
parent d89e785440
commit 7a1d2ca205
42 changed files with 166 additions and 166 deletions
+6 -6
View File
@@ -199,10 +199,10 @@ TestClient.prototype.getWidget = function (widgetName, params, callback) {
self.keysToDelete['user:localhost:mapviews:global'] = 5;
var urlParams = {
own_filter: params.hasOwnProperty('own_filter') ? params.own_filter : 1
own_filter: Object.prototype.hasOwnProperty.call(params, 'own_filter') ? params.own_filter : 1
};
['bbox', 'bins', 'start', 'end'].forEach(function (extraParam) {
if (params.hasOwnProperty(extraParam)) {
if (Object.prototype.hasOwnProperty.call(params, extraParam)) {
urlParams[extraParam] = params[extraParam];
}
});
@@ -309,7 +309,7 @@ TestClient.prototype.widgetSearch = function (widgetName, userQuery, params, cal
var urlParams = {
q: userQuery,
own_filter: params.hasOwnProperty('own_filter') ? params.own_filter : 1
own_filter: Object.prototype.hasOwnProperty.call(params, 'own_filter') ? params.own_filter : 1
};
if (params && params.bbox) {
urlParams.bbox = params.bbox;
@@ -478,15 +478,15 @@ TestClient.prototype.getDataview = function (dataviewName, params, callback) {
self.keysToDelete['user:localhost:mapviews:global'] = 5;
var urlParams = {};
if (params.hasOwnProperty('no_filters')) {
if (Object.prototype.hasOwnProperty.call(params, 'no_filters')) {
urlParams.no_filters = params.no_filters;
}
if (params.hasOwnProperty('own_filter')) {
if (Object.prototype.hasOwnProperty.call(params, 'own_filter')) {
urlParams.own_filter = params.own_filter;
}
['bbox', 'bins', 'start', 'end', 'aggregation', 'offset', 'categories'].forEach(function (extraParam) {
if (params.hasOwnProperty(extraParam)) {
if (Object.prototype.hasOwnProperty.call(params, extraParam)) {
urlParams[extraParam] = params[extraParam];
}
});