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

bluefeather

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluefeather - npm Package Compare versions

Comparing version

to
2.3.1

14

dist/suppress.js

@@ -8,13 +8,11 @@ "use strict";

const suppress = async (ErrorConstructor, promise) => {
try {
return await promise;
} catch (error) {
const suppress = (ErrorConstructor, promise) => {
return promise.catch(error => {
if (error instanceof ErrorConstructor) {
// eslint-disable-next-line consistent-return
// eslint-disable-next-line no-useless-return
return;
} else {
throw error;
}
throw error;
}
});
};

@@ -21,0 +19,0 @@

@@ -64,3 +64,3 @@ {

},
"version": "2.3.0"
"version": "2.3.1"
}
// @flow
type SuppressType = <T: *>(
type SuppressType = <T: Promise<*>>(
ErrorConstructor: Class<Error>,
promise: Promise<T>
promise: T
) => Promise<T | void>;
const suppress: SuppressType = async (ErrorConstructor, promise) => {
try {
return await promise;
} catch (error) {
if (error instanceof ErrorConstructor) {
// eslint-disable-next-line consistent-return
return;
}
throw error;
}
const suppress: SuppressType = (ErrorConstructor, promise) => {
return promise
.catch((error) => {
if (error instanceof ErrorConstructor) {
// eslint-disable-next-line no-useless-return
return;
} else {
throw error;
}
});
};
export default suppress;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet