New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

east-mongo

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

east-mongo - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

28

lib/adapter.js

@@ -21,3 +21,3 @@ 'use strict';

self.collection = db.collection('_migrations');
callback(null, {db: db});
callback(null, {db: db, dropIndexIfExists: dropIndexIfExists});
});

@@ -45,2 +45,28 @@ };

/**
* Helpers which will be exposed to migration
*/
function dropIndexIfExists(collection, index, callback) {
var indexName = '';
// convert object to string coz `indexExists` don't recognize objects
if (typeof index === 'object') {
for (var key in index) {
indexName += '_' + key + '_' + index[key];
}
indexName = indexName.replace(/^_/, '');
} else {
indexName = index;
}
collection.indexExists(indexName, function(err, exist) {
if (err) {callback(err); return;}
if (exist) {
collection.dropIndex(indexName, callback);
} else {
callback();
}
});
}
module.exports = Adapter;

2

package.json
{
"name": "east-mongo",
"description": "mongodb adapter for \"east\" (node.js database migration tool)",
"version": "0.1.1",
"version": "0.1.2",
"author": "Oleg Korobenko <oleg.korobenko@gmail.com>",

@@ -6,0 +6,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc