Skip to content

Commit

Permalink
[eslint] Change hasOwnProperty to use in
Browse files Browse the repository at this point in the history
  • Loading branch information
valtlfelipe committed Sep 13, 2019
1 parent ee85ffb commit a4f9319
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/DB.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ class DB {
this.sequelize = sequelize;
this.models = models;
}

getModel(name) {
return this.models.hasOwnProperty(name) ? this.models[name] : null;
return name in this.models ? this.models[name] : null;
}

getModels() {
return this.models;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
async function getFiles(paths, ignored) {
const options = {
nodir: true,
dot: false
dot: false,
};

if (!Array.isArray(paths)) {
Expand Down Expand Up @@ -52,7 +52,7 @@ async function applyRelations(models) {
}

Object.keys(models).forEach(name => {
if (models[name].hasOwnProperty('associate')) {
if ('associate' in models[name]) {
models[name].associate(models);
}
});
Expand Down

0 comments on commit a4f9319

Please sign in to comment.