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

@emigrate/plugin-tools

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emigrate/plugin-tools - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

20

dist/index.js
import process from 'node:process';
export const serializeError = (error) => {
return {
const properties = {
name: error.name,
message: error.message,
stack: error.stack,
cause: error.cause instanceof Error ? serializeError(error.cause) : error.cause,
};
for (const key of Object.getOwnPropertyNames(error)) {
const value = error[key];
properties[key] = value instanceof Error ? serializeError(value) : value;
}
return properties;
};

@@ -108,10 +110,2 @@ export const isGeneratorPlugin = (plugin) => {

};
const getImportFromEsm = async () => {
const importFromEsm = await import('import-from-esm');
// Because of "allowSyntheticDefaultImports" we need to do this ugly hack
if (importFromEsm.default) {
return importFromEsm.default;
}
return importFromEsm;
};
const loadPlugin = async (type, plugin) => {

@@ -123,3 +117,3 @@ return load(plugin, ['@emigrate/plugin-', 'emigrate-plugin-', '@emigrate/'], (value) => {

const load = async (name, prefixes, check) => {
const importFromEsm = await getImportFromEsm();
const { default: importFromEsm } = await import('import-from-esm');
const importsToTry = name.startsWith('.') ? [name] : [...prefixes.map((prefix) => `${prefix}${name}`), name];

@@ -126,0 +120,0 @@ for await (const importPath of importsToTry) {

@@ -7,3 +7,4 @@ export type Awaitable<T> = T | PromiseLike<T>;

export type SerializedError = {
name: string;
[key: string]: unknown;
name?: string;
message: string;

@@ -73,3 +74,3 @@ stack?: string;

*/
onError(migration: MigrationMetadataFinished, error: SerializedError): Promise<void>;
onError(migration: MigrationMetadataFinished, error: Error): Promise<void>;
/**

@@ -148,4 +149,5 @@ * Called when the command is finished or aborted (e.g. by a SIGTERM or SIGINT signal).

duration: number;
error?: SerializedError;
error?: Error;
};
export declare const isFinishedMigration: (migration: MigrationMetadata | MigrationMetadataFinished) => migration is MigrationMetadataFinished;
export type LoaderPlugin = {

@@ -152,0 +154,0 @@ /**

@@ -1,2 +0,4 @@

export {};
export const isFinishedMigration = (migration) => {
return 'status' in migration;
};
//# sourceMappingURL=types.js.map
{
"name": "@emigrate/plugin-tools",
"version": "0.5.0",
"version": "0.6.0",
"publishConfig": {

@@ -39,3 +39,3 @@ "access": "public"

"dependencies": {
"import-from-esm": "1.2.1"
"import-from-esm": "1.3.3"
},

@@ -42,0 +42,0 @@ "volta": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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