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 6.6.1 to 6.6.2

2

package.json
{
"name": "wayfarer",
"version": "6.6.1",
"version": "6.6.2",
"description": "Composable trie based router",

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

@@ -216,2 +216,34 @@ var wayfarer = require('../')

t.test('wildcards dont conflict with params', function (t) {
t.plan(3)
var router
router = wayfarer()
router.on('/*', function (params) {
t.fail('wildcard called')
})
router.on('/:match', function (params) {
t.pass('param called')
})
router('/foo')
router = wayfarer()
router.on('/*', function (params) {
t.fail('wildcard called')
})
router.on('/:match/foo', function (params) {
t.pass('param called')
})
router('/foo/foo')
router = wayfarer()
router.on('/*', function (params) {
t.pass('wildcard called')
})
router.on('/:match/foo', function (params) {
t.fail('param called')
})
router('/foo/bar')
})
t.test('safe decodeURIComponent', function (t) {

@@ -218,0 +250,0 @@ t.plan(1)

@@ -73,2 +73,10 @@ var mutate = require('xtend/mutable')

return search(index + 1, trie.nodes[thisRoute])
} else if (trie.name) {
// match named routes
try {
params[trie.name] = decodeURIComponent(thisRoute)
} catch (e) {
return search(index, undefined)
}
return search(index + 1, trie.nodes['$$'])
} else if (trie.wildcard) {

@@ -83,10 +91,2 @@ // match wildcards

return trie.nodes['$$']
} else if (trie.name) {
// match named routes
try {
params[trie.name] = decodeURIComponent(thisRoute)
} catch (e) {
return search(index, undefined)
}
return search(index + 1, trie.nodes['$$'])
} else {

@@ -93,0 +93,0 @@ // no matches found

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