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

express-exorcism

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-exorcism - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.travis.yml

1

.eslintrc.json

@@ -94,3 +94,2 @@ {

],
"no-throw-literal": 2,
"no-eval": 2,

@@ -97,0 +96,0 @@ "no-unneeded-ternary": 2,

@@ -24,7 +24,5 @@ 'use strict';

var config = Object.assign({}, defaultConfig, userConfig);
console.log('Using config: ', config);
// Wraps Router's method with async resolver
function methodWrapper(routerMethod, responseMethod) {
console.log('[methodWrapper] wrapping ' + routerMethod + ' using response ' + responseMethod);
return function () {

@@ -36,22 +34,15 @@ var args = Array.prototype.slice.call(arguments);

if (!handler || !handler.constructor || handler.constructor.name !== 'AsyncFunction') {
console.log('[methodWrapper] Sync ' + routerMethod);
return Router[PREFIX + routerMethod].apply(this, arguments);
}
console.log('[methodWrapper] Async ' + routerMethod + ' using response ' + responseMethod);
return Router[PREFIX + routerMethod].apply(this, otherArguments.concat(function (req, res, next) {
handler.apply(null, arguments)
.then(function (result) {
console.log('[Promise] success using ' + responseMethod);
if (config.ignoreEmptyResolvedData && (result === null || result === undefined || result === false)) {
console.log('[Promise] success, ignoring empty result');
return;
} else if (responseMethod === 'none' || !res[responseMethod]) {
console.log('[Promise] success, responseMethod === "none" or not exists');
return;
} else if (responseMethod === 'end') {
console.log('[Promise] success end');
res.end();
} else {
console.log('[Promise] success - sending ' + responseMethod);
res[responseMethod](result);

@@ -61,3 +52,2 @@ }

.catch(function (error) {
console.log('[Promise catch] -> next');
next(error);

@@ -77,3 +67,2 @@ });

.map(function (methodName) {
console.log('Wrapping ' + methodName + ' using response ' + config.defaultResponseMethod);
return {

@@ -87,3 +76,2 @@ name: methodName,

if (config.replaceOriginalMethods) {
console.log('Replacing ' + method.name + ' with: ', method.wrapped);
Router[method.name] = method.wrapped;

@@ -90,0 +78,0 @@ }

{
"name": "express-exorcism",
"version": "0.0.1",
"version": "0.0.2",
"description": "",
"main": "lib/express-exorcism.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha"
},
"author": "Andrew G Kuznetsov <cav@cav.ru>",
"license": "ISC",
"engines": {
"node": ">=7.5.0"
},
"dependencies": {

@@ -16,5 +19,7 @@ "is-promise": "^2.1.0",

"devDependencies": {
"express": "^4.16.2",
"eslint": "^4.14.0"
"chai": "^4.1.2",
"chai-http": "^3.0.0",
"eslint": "^4.14.0",
"express": "^4.16.2"
}
}

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