Socket
Socket
Sign inDemoInstall

koa-router

Package Overview
Dependencies
Maintainers
1
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.3.0 to 5.4.0

9

history.md
# History
## 7.0.0
## 5.4.0
- The API has changed to match the new promise-based middleware
signature of koa 2. See the
[koa 2.x readme](https://github.com/koajs/koa/tree/2.0.0-alpha.3) for more
information.
- Middleware is now always run in the order declared by `.use()` (or `.get()`,
etc.), which matches Express 4 API.
- Expose matched route at `ctx._matchedRoute`.

@@ -12,0 +7,0 @@ ## 5.3.0

@@ -86,3 +86,4 @@ /**

*
* Route paths will be translated to regular expressions used to match requests.
* Route paths will be translated to regular expressions using
* [path-to-regexp](https://github.com/pillarjs/path-to-regexp).
*

@@ -314,2 +315,6 @@ * Query strings will not be considered when matching requests.

i = matched.pathAndMethod.length;
var mostSpecificPath = matched.pathAndMethod[matched.pathAndMethod.length - 1].path
this._matchedRoute = mostSpecificPath
while (matched.route && i--) {

@@ -492,3 +497,3 @@ layer = matched.pathAndMethod[i];

*
* @param {String} path Path string or regular expression.
* @param {String} path Path string.
* @param {Array.<String>} methods Array of HTTP verbs.

@@ -579,4 +584,3 @@ * @param {Function} middleware Multiple middleware also accepted.

/**
* Generate URL for route. Takes either map of named `params` or series of
* arguments (for regular expression routes).
* Generate URL for route. Takes a route name and map of named `params`.
*

@@ -583,0 +587,0 @@ * ```javascript

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

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

@@ -16,0 +16,0 @@ "koa",

@@ -15,3 +15,3 @@ # koa-router

* Nestable routers.
* ES7 async/await support.
* ES7 async/await support (koa-router 7.x).

@@ -21,3 +21,3 @@ ## koa 2.x

See [koa-router 7.x](https://github.com/alexmingoia/koa-router/tree/master/)
for koa 2.x support.
for koa 2.x and async/await support.

@@ -99,3 +99,4 @@ ## Installation

Route paths will be translated to regular expressions used to match requests.
Route paths will be translated to regular expressions using
[path-to-regexp](https://github.com/pillarjs/path-to-regexp).

@@ -239,3 +240,3 @@ Query strings will not be considered when matching requests.

| [options.throw] | <code>Boolean</code> | throw error instead of setting status and header |
| [options.notImplemented] | <code>Function</code> | throw throw the returned value in place of the default NotImplemented error |
| [options.notImplemented] | <code>Function</code> | throw the returned value in place of the default NotImplemented error |
| [options.methodNotAllowed] | <code>Function</code> | throw the returned value in place of the default MethodNotAllowed error |

@@ -304,4 +305,3 @@

#### router.url(name, params) ⇒ <code>String</code> &#124; <code>Error</code>
Generate URL for route. Takes either map of named `params` or series of
arguments (for regular expression routes).
Generate URL for route. Takes the route name and a map of named `params`.

@@ -308,0 +308,0 @@ ```javascript

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