1 | var raw_connect = require('./lib/connect').connect;
|
2 | var CallbackModel = require('./lib/callback_model').CallbackModel;
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | function connect(url, options, cb) {
|
9 | if (typeof url === 'function')
|
10 | cb = url, url = false, options = false;
|
11 | else if (typeof options === 'function')
|
12 | cb = options, options = false;
|
13 |
|
14 | raw_connect(url, options, function(err, c) {
|
15 | if (err === null) cb(null, new CallbackModel(c));
|
16 | else cb(err);
|
17 | });
|
18 | };
|
19 |
|
20 | module.exports.connect = connect;
|
21 | module.exports.credentials = require('./lib/credentials');
|
22 | module.exports.IllegalOperationError = require('./lib/error').IllegalOperationError;
|