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 7.3.0 to 7.3.1

11

index.js

@@ -226,9 +226,14 @@ 'use strict'

const charCode = path.charCodeAt(lastParamEndIndex)
if (charCode === 58 || charCode === 47) {
break
const nextCharCode = path.charCodeAt(lastParamEndIndex + 1)
if (charCode === 58 && nextCharCode === 58) {
lastParamEndIndex++
continue
}
if (charCode === 58 || charCode === 47) break
}
const staticPart = path.slice(j, lastParamEndIndex)
let staticPart = path.slice(j, lastParamEndIndex)
if (staticPart) {
staticPart = staticPart.split('::').join(':')
staticPart = staticPart.split('%').join('%25')
regexps.push(escapeRegExp(staticPart))

@@ -235,0 +240,0 @@ }

{
"name": "find-my-way",
"version": "7.3.0",
"version": "7.3.1",
"description": "Crazy fast http radix based router",

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

@@ -206,2 +206,23 @@ 'use strict'

test('Multi parametric route with colon separator', t => {
t.plan(3)
const findMyWay = FindMyWay({
defaultRoute: (req, res) => {
t.fail('Should not be defaultRoute')
}
})
findMyWay.on('GET', '/:param(.*)::suffix', (req, res, params) => {
t.equal(params.param, 'foo')
})
findMyWay.on('GET', '/:param1(.*)::suffix1-:param2(.*)::suffix2/static', (req, res, params) => {
t.equal(params.param1, 'foo')
t.equal(params.param2, 'bar')
})
findMyWay.lookup({ method: 'GET', url: '/foo:suffix', headers: {} }, null)
findMyWay.lookup({ method: 'GET', url: '/foo:suffix1-bar:suffix2/static', headers: {} }, null)
})
test('Multi parametric route with regexp / 2', t => {

@@ -208,0 +229,0 @@ t.plan(8)

@@ -100,2 +100,17 @@ 'use strict'

test('Multi parametric route with encoded colon separator', t => {
t.plan(1)
const findMyWay = FindMyWay({
defaultRoute: (req, res) => {
t.fail('Should not be defaultRoute')
}
})
findMyWay.on('GET', '/:param(.*)::suffix', (req, res, params) => {
t.equal(params.param, 'foo-bar')
})
findMyWay.lookup({ method: 'GET', url: '/foo-bar%3Asuffix', headers: {} }, null)
})
function get (url) {

@@ -102,0 +117,0 @@ return { method: 'GET', url, headers: {} }

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