Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Tcb.prototype.database = function(dbConfig = {}) {
Db.reqClass = Request
if (Object.prototype.toString.call(dbConfig).slice(8, -1) !== 'Object') {
throw Error('dbConfig must be an object')
}
if (dbConfig && dbConfig.env) {
// env变量名转换
dbConfig.envName = dbConfig.env
delete dbConfig.env
}
this.config = Object.assign(this.config, dbConfig)
return new Db({ ...this })
}