Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Mongorito.connect = function connect() {
for (var _len = arguments.length, urls = Array(_len), _key = 0; _key < _len; _key++) {
urls[_key] = arguments[_key];
}
// convert mongo:// urls to monk-supported ones
urls = urls.map(function (url) {
return url.replace(/^mongo\:\/\//, "");
});
var db = monk.apply(null, urls);
// if there is already a connection
// don't overwrite it with a new one
if (!this.db) this.db = db;
return db;
};