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

find-my-way

Package Overview
Dependencies
Maintainers
2
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-my-way - npm Package Compare versions

Comparing version 1.15.3 to 1.15.4

6

index.js

@@ -145,3 +145,7 @@ 'use strict'

if (i === len) {
return this._insert(method, path.slice(0, i), nodeType, params, handler, store, regex, version)
var completedPath = path.slice(0, i)
if (this.caseSensitive === false) {
completedPath = completedPath.toLowerCase()
}
return this._insert(method, completedPath, nodeType, params, handler, store, regex, version)
}

@@ -148,0 +152,0 @@ // add the parameter and continue with the search

2

package.json
{
"name": "find-my-way",
"version": "1.15.3",
"version": "1.15.4",
"description": "Crazy fast http radix based router",

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

@@ -91,1 +91,47 @@ 'use strict'

})
test('case insensitive with capital letter in static path with param', t => {
t.plan(1)
const findMyWay = FindMyWay({
caseSensitive: false,
defaultRoute: (req, res) => {
t.fail('Should not be defaultRoute')
}
})
findMyWay.on('GET', '/Foo/bar/:param', (req, res, params) => {
console.log('baz')
t.equal(params.param, 'baz')
})
findMyWay.lookup({ method: 'GET', url: '/Foo/bar/baz', headers: {} }, null)
})
test('case insensitive with multiple paths containing capital letter in static path with param', t => {
/*
* This is a reproduction of the issue documented at
* https://github.com/delvedor/find-my-way/issues/96.
*/
t.plan(2)
const findMyWay = FindMyWay({
caseSensitive: false,
defaultRoute: (req, res) => {
t.fail('Should not be defaultRoute')
}
})
findMyWay.on('GET', '/Foo/bar/:param', (req, res, params) => {
console.log('baz')
t.equal(params.param, 'baz')
})
findMyWay.on('GET', '/Foo/baz/:param', (req, res, params) => {
console.log('bar')
t.equal(params.param, 'bar')
})
findMyWay.lookup({ method: 'GET', url: '/Foo/bar/baz', headers: {} }, null)
findMyWay.lookup({ method: 'GET', url: '/Foo/baz/bar', headers: {} }, null)
})
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