Fixed linter errors
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2022-11-04 21:30:31 -04:00
parent a297829ffc
commit 4a43aaabb6

View File

@ -12,6 +12,11 @@ db.items = require('./item.js')(sequelize, Sequelize);
module.exports = db; module.exports = db;
/**
* Initializes a sequelize database connection.
*
* @return {object} - sequelize connection
*/
function initDatabase() { function initDatabase() {
let sequelize = null; let sequelize = null;
@ -21,7 +26,10 @@ function initDatabase() {
storage: dbConfig.get('connection_string'), storage: dbConfig.get('connection_string'),
}); });
} else { } else {
sequelize = new Sequelize(dbConfig.get('name'), dbConfig.get('username'), dbConfig.get('password'), { const dbName = dbConfig.get('name');
const dbUsername = dbConfig.get('username');
const dbPassword = dbConfig.get('password');
sequelize = new Sequelize(dbName, dbUsername, dbPassword, {
dialect: dbConfig.get('driver'), dialect: dbConfig.get('driver'),
host: dbConfig.get('address'), host: dbConfig.get('address'),
}); });