mongodb-aws-documentdb-tunneling
Advanced tools
Comparing version 1.0.0-alpha.28 to 1.0.0-alpha.29
25
index.js
@@ -9,5 +9,8 @@ const MONGODB_LOCAL = require('./clients/mongodb.local.client') | ||
*/ | ||
let MongoClient | ||
let Client | ||
module.exports.MongoClient = () => MongoClient | ||
/** | ||
* @type {() => import('mongodb').MongoClient} | ||
*/ | ||
module.exports.Client = () => Client | ||
@@ -19,5 +22,4 @@ /** | ||
* @async | ||
* @callback | ||
*/ | ||
module.exports.init = (options, callback = null) => { | ||
module.exports.init = options => { | ||
@@ -31,3 +33,3 @@ const environmentValidation = JOI | ||
.validate(options, { allowUnknown: true }) | ||
if (environmentValidation.error) return Promise.reject(environmentValidation.error) | ||
if (environmentValidation.error) throw environmentValidation.error | ||
@@ -45,14 +47,9 @@ /** | ||
MongoClient = client | ||
DEBUG(message) | ||
return callback | ||
? callback(null, message) | ||
: Promise.resolve(message) | ||
Client = client | ||
return message | ||
} | ||
) | ||
.catch( | ||
error => callback | ||
? callback(error) | ||
: Promise.resolve(error) | ||
) | ||
} | ||
@@ -59,0 +56,0 @@ |
{ | ||
"name": "mongodb-aws-documentdb-tunneling", | ||
"version": "1.0.0-alpha.28", | ||
"version": "1.0.0-alpha.29", | ||
"description": "Mongodb wich allow SSH tunneling into a AWS documentDb VPC by going through a EC2 instance hosted in the same VPC.", | ||
@@ -25,3 +25,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "51f3c764dd07106c332ddf3084d0ad9dafd0c3a8" | ||
"gitHead": "fb93220d70e2dbac5030e2345e872a6b58dd0213" | ||
} |
12121
267