不要怂,就是干,撸起袖子干!

Commit aec8f8a6 by Sascha Depold

better option usage

1 parent b27e5512
Showing with 7 additions and 9 deletions
......@@ -5,20 +5,18 @@ var Utils = require("./utils")
module.exports = (function() {
var Sequelize = function(database, username, password, options) {
options = options || {}
Utils._.reject(options, function(_, key) {
return ["host", "port", "disableTableNameModification"].indexOf(key) > -1
})
this.options = Utils._.extend({
connector: 'mysql',
host: 'localhost',
port: 3306,
}, options || {})
this.options = options
this.options.connector = this.options.connector || 'mysql'
this.config = {
database: database,
username: username,
password: (( (["", null, false].indexOf(password) > -1) || (typeof password == 'undefined')) ? null : password),
host : options.host || 'localhost',
port : options.port || 3306
host : this.options.host,
port : this.options.port
}
var ConnectorManager = require("./connectors/" + this.options.connector + "/connector-manager")
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!