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

wayfarer

Package Overview
Dependencies
Maintainers
4
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wayfarer - npm Package Compare versions

Comparing version 4.2.0 to 4.3.0

24

index.js

@@ -38,3 +38,3 @@ const routington = require('routington')

// str -> null
function emit (path, params) {
function emit (path, params, parentDefault) {
path = sanitizeUri(path) || ''

@@ -46,3 +46,4 @@ params = params || {}

const match = sub ? sub.match : router.match(path) || router.match(dft)
const localDft = router.match(dft) || parentDefault
const match = sub ? sub.match : router.match(path) || localDft
assert.ok(match, 'path ' + path + ' did not match')

@@ -53,3 +54,3 @@ params = xtend(params, match.param)

match.node.cb.forEach(function (cb) {
sub ? cb(path, params) : cb(params)
sub ? cb(path, params, localDft) : cb(params)
})

@@ -76,4 +77,7 @@ }

var nw = ''
while (++cnt < ln) nw = nw ? nw.concat('/', split[cnt]) : split[cnt]
while (++cnt < ln) {
nw = nw ? nw.concat('/', split[cnt]) : split[cnt]
}
var imatch = mounts.match(nw)

@@ -89,5 +93,13 @@ if (imatch) {

if (!match) return
while (count--) split.shift()
while (count--) {
split.shift()
}
path = split.join('/')
return { match: match, path: path }
const ret = {
match: match,
path: path
}
return ret
}

@@ -94,0 +106,0 @@ }

{
"name": "wayfarer",
"version": "4.2.0",
"version": "4.3.0",
"description": "Composable trie based router",

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

@@ -36,3 +36,4 @@ # wayfarer

Routers can be infinitely nested, allowing routing to be scoped per view.
Matched params are passed into subrouters.
Matched params are passed into subrouters. Nested routes will call their
parent's default handler if no path matches.
```js

@@ -39,0 +40,0 @@ const r1 = wayfarer()

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