Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(db = { url: '', username: '', password: '' }) {
const { url, username, password } = db;
const isLocal = url === '*LOCAL';
// eslint-disable-next-line new-cap
this.dbconn = new dbconn();
if (isLocal && !username && !password) {
this.connect();
} else if (url && username && password) {
this.connect(url, username, password);
}
}
constructor(connection) {
if (!connection) {
// eslint-disable-next-line no-param-reassign
connection = createConnection();
}
this.dbc = connection.dbconn;
// eslint-disable-next-line new-cap
this.stmt = new dbstmt(this.dbc);
}