Socket
Socket
Sign inDemoInstall

koa-router

Package Overview
Dependencies
Maintainers
2
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-router - npm Package Compare versions

Comparing version 5.4.1 to 5.4.2

24

lib/router.js

@@ -12,2 +12,3 @@ /**

var Layer = require('./layer');
var co = require('co');

@@ -326,7 +327,6 @@ /**

while (ii--) {
if (layer.stack[ii].constructor.name === 'GeneratorFunction') {
next = layer.stack[ii].call(this, next);
} else {
next = Promise.resolve(layer.stack[ii].call(this, next));
}
var stack = layer.stack[ii].constructor.name === 'GeneratorFunction'
? layer.stack[ii]
: wrapAsyncToGenerator(layer.stack[ii]);
next = stack.call(this, next);
}

@@ -336,7 +336,3 @@ }

if (typeof next.next === 'function') {
yield *next;
} else {
yield next;
}
yield *next;
};

@@ -704,1 +700,9 @@

};
function wrapAsyncToGenerator(fn) {
return function* (next) {
var p = fn.call(this, co(next));
// only yield if return a promise
if (p && typeof p.then === 'function') return yield p;
}
}

@@ -13,3 +13,3 @@ {

"author": "Alex Mingoia <talk@alexmingoia.com>",
"version": "5.4.1",
"version": "5.4.2",
"keywords": [

@@ -22,2 +22,3 @@ "koa",

"dependencies": {
"co": "^4.6.0",
"debug": "^2.2.0",

@@ -24,0 +25,0 @@ "http-errors": "^1.3.1",

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