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

koa-trie-router

Package Overview
Dependencies
Maintainers
9
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-trie-router - npm Package Compare versions

Comparing version 1.0.10 to 1.1.0

HISTORY.md

7

lib/dispatcher.js

@@ -7,3 +7,8 @@ var Router = require('./router')

return function* trieRouter (next) {
var match = trie.match(this.request.path)
try {
var match = trie.match(this.request.path)
} catch (err) {
err.code = 'MALFORMEDURL'
throw err
}
var node = match && match.node

@@ -10,0 +15,0 @@ // If no route match or no methods are defined, go to next middleware

8

package.json
{
"name": "koa-trie-router",
"description": "Trie-routing for Koa",
"version": "1.0.10",
"version": "1.1.0",
"author": {

@@ -28,5 +28,5 @@ "name": "Jonathan Ong",

"scripts": {
"test": "mocha --harmony-generators --reporter spec --require should",
"test-cov": "node --harmony-generators node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --require should",
"test-travis": "node --harmony-generators node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot --require should"
"test": "mocha --harmony --reporter spec --require should",
"test-cov": "node --harmony node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --require should",
"test-travis": "node --harmony node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot --require should"
},

@@ -33,0 +33,0 @@ "files": [

@@ -109,2 +109,9 @@ # Koa Trie Router

### Error handling
The middleware throws an error with `code` _MALFORMEDURL_ when it encounters
a malformed path. An application can _try/catch_ this upstream, identify the error
by its code, and handle it however the developer chooses in the context of the
application- for example, re-throw as a 404.
### Path Definitions

@@ -111,0 +118,0 @@

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