Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

east

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

east - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

32

lib/migrator.js

@@ -51,12 +51,34 @@ 'use strict';

Migrator.prototype._createAdapter = function(adapter, params) {
Migrator.prototype._tryLoadAdapter = function(path) {
try {
return new (require(adapter))(params);
return require(path);
} catch (err) {
err.message =
'Error while loading adapter `' + adapter + '`:\n' + err.message;
throw err;
return err;
}
};
Migrator.prototype._createAdapter = function(adapterPath, params) {
// try load adapter from migrator-related path first then from cwd-related
var paths = [adapterPath, path.join(process.cwd(), adapterPath)],
Adapter,
errors = [];
for (var i = 0; i < paths.length; i++) {
Adapter = this._tryLoadAdapter(paths[i]);
if (Adapter instanceof Error) {
errors.push(Adapter);
} else {
break;
}
}
// if adapter is not loaded put all error messages into throwing error
if (Adapter instanceof Error) {
var error = new Error('Error loading adapter from all paths:\n');
errors.forEach(function(err) {
error.message += '\n' + (err.stack || err.message) + '\n';
});
throw error;
}
return new Adapter(params);
};
Migrator.prototype.init = function(callback) {

@@ -63,0 +85,0 @@ if (this.isDirExists()) throw Error(

2

package.json
{
"name": "east",
"description": "node.js database migration tool",
"version": "0.2.1",
"version": "0.2.2",
"author": "Oleg Korobenko <oleg.korobenko@gmail.com>",

@@ -6,0 +6,0 @@ "license": "MIT",

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