Avoid calling Object.prototype methods directly on object instances
This commit is contained in:
@@ -82,7 +82,7 @@ function prepareResponse () {
|
||||
}, {});
|
||||
|
||||
const analysisCatalog = catalog.map(analysis => {
|
||||
if (analysisIdToTable.hasOwnProperty(analysis.node_id)) {
|
||||
if (Object.prototype.hasOwnProperty.call(analysisIdToTable, analysis.node_id)) {
|
||||
analysis.table = analysisIdToTable[analysis.node_id];
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ function errorMessageWithContext (err) {
|
||||
|
||||
for (var prop in err) {
|
||||
// type & message are properties from Error's prototype and will be skipped
|
||||
if (err.hasOwnProperty(prop) && shouldBeExposed(prop)) {
|
||||
if (Object.prototype.hasOwnProperty.call(err, prop) && shouldBeExposed(prop)) {
|
||||
error[prop] = err[prop];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ module.exports = function lzma () {
|
||||
const lzmaWorker = new LZMA();
|
||||
|
||||
return function lzmaMiddleware (req, res, next) {
|
||||
if (!req.query.hasOwnProperty('lzma')) {
|
||||
if (!Object.prototype.hasOwnProperty.call(req.query, 'lzma')) {
|
||||
return next();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user