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

koa2-router

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa2-router - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

12

lib/index.js

@@ -104,3 +104,3 @@ /*!

if ('string' !== typeof name) {
throw new Error('invalid param() call, got name type ' + typeof name);
throw new TypeError('invalid param() call, got name type ' + gettype(name));
}

@@ -115,3 +115,3 @@

if ('function' !== typeof fn) {
throw new Error('invalid param() call for ' + name + ', got ' + fn);
throw new TypeError('invalid param() call for ' + name + ', got ' + gettype(fn));
}

@@ -387,3 +387,3 @@

// single param callbacks
function paramCallback() {
async function paramCallback() {
var fn = paramCallbacks[paramIndex++];

@@ -396,6 +396,8 @@

return fn(ctx, paramCallback, paramVal, key.name).catch(function(e) {
try {
await fn(ctx, paramCallback, paramVal, key.name);
} finally {
// store updated value
paramCalled.value = ctx.params[key.name];
});
}
}

@@ -402,0 +404,0 @@ };

@@ -61,3 +61,7 @@ /*!

// promisify the handle result
return Promise.resolve(fn(ctx, next));
try {
return Promise.resolve(fn(ctx, next));
} catch(e) {
return Promise.reject(e);
}
};

@@ -64,0 +68,0 @@

@@ -195,3 +195,3 @@ /*!

var msg = 'Route.' + method + '() requires a callback function but got a ' + type
throw new Error(msg);
throw new TypeError(msg);
}

@@ -198,0 +198,0 @@

{
"name": "koa2-router",
"version": "1.0.2",
"version": "1.0.3",
"description": "A express-liked router component for koa2",

@@ -5,0 +5,0 @@ "main": "index.js",

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