Comparing version 4.0.2 to 4.1.0
@@ -30,3 +30,4 @@ const routington = require('routington') | ||
const node = cb[sym] ? mounts.define(path)[0] : router.define(path)[0] | ||
node.cb = cb | ||
if (Array.isArray(node.cb)) node.cb.push(cb) | ||
else node.cb = [cb] | ||
return emit | ||
@@ -49,3 +50,5 @@ } | ||
// only nested routers need a path | ||
sub ? match.node.cb(path, params) : match.node.cb(params) | ||
match.node.cb.forEach(function (cb) { | ||
sub ? cb(path, params) : cb(params) | ||
}) | ||
} | ||
@@ -52,0 +55,0 @@ |
{ | ||
"name": "wayfarer", | ||
"version": "4.0.2", | ||
"version": "4.1.0", | ||
"description": "Composable trie based router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -54,3 +54,4 @@ # wayfarer | ||
Register a new route. The order in which routes are registered does not matter. | ||
See [`routington.define()`](https://github.com/pillarjs/routington#nodes-node--routerdefineroute) | ||
Multiple callbacks can be registered. See | ||
[`routington.define()`](https://github.com/pillarjs/routington#nodes-node--routerdefineroute) | ||
for all route options. | ||
@@ -57,0 +58,0 @@ |
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
6851
74
85