@koa/router
Advanced tools
Comparing version 9.0.1 to 9.1.0
@@ -362,3 +362,8 @@ /** | ||
ctx.params = layer.params(path, ctx.captures, ctx.params); | ||
ctx.routerPath = layer.path; | ||
ctx.routerName = layer.name; | ||
ctx._matchedRoute = layer.path; | ||
if (layer.name) { | ||
ctx._matchedRouteName = layer.name; | ||
} | ||
return next(); | ||
@@ -444,3 +449,3 @@ }); | ||
: new HttpError.NotImplemented(); | ||
throw notImplementedThrowable; | ||
@@ -458,3 +463,3 @@ } else { | ||
if (options.throw) { | ||
let notAllowedThrowable = (typeof options.methodNotAllowed === 'function') | ||
let notAllowedThrowable = (typeof options.methodNotAllowed === 'function') | ||
? options.methodNotAllowed() // set whatever the user returns from their function | ||
@@ -461,0 +466,0 @@ : new HttpError.MethodNotAllowed(); |
{ | ||
"name": "@koa/router", | ||
"description": "Router middleware for koa. Provides RESTful resource routing.", | ||
"version": "9.0.1", | ||
"version": "9.1.0", | ||
"author": "Alex Mingoia <talk@alexmingoia.com>", | ||
@@ -6,0 +6,0 @@ "bugs": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35375
870