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.0.0 to 7.0.1

11

index.js

@@ -277,5 +277,14 @@ 'use strict'

const isRootWildcard = path === '*' || path === '/*'
for (const existRoute of this._routesPatterns) {
let samePath = false
if (existRoute.path === path) {
samePath = true
} else if (isRootWildcard && (existRoute.path === '/*' || existRoute.path === '*')) {
samePath = true
}
if (
existRoute.path === path &&
samePath &&
existRoute.method === method &&

@@ -282,0 +291,0 @@ deepEqual(existRoute.constraints, constraints)

4

lib/pretty-print.js

@@ -110,5 +110,3 @@ 'use strict'

function buildRouteTree (mergedRouteArray, rootPath) {
rootPath = rootPath || pathDelimiter
function buildRouteTree (mergedRouteArray) {
const result = []

@@ -115,0 +113,0 @@ const temp = { result }

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

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

@@ -248,2 +248,28 @@ 'use strict'

test('Method already declared if * is used', t => {
t.plan(1)
const findMyWay = FindMyWay()
findMyWay.on('GET', '/*', () => {})
try {
findMyWay.on('GET', '*', () => {})
t.fail('should throw error')
} catch (e) {
t.equal(e.message, 'Method \'GET\' already declared for route \'*\' with constraints \'{}\'')
}
})
test('Method already declared if /* is used', t => {
t.plan(1)
const findMyWay = FindMyWay()
findMyWay.on('GET', '*', () => {})
try {
findMyWay.on('GET', '/*', () => {})
t.fail('should throw error')
} catch (e) {
t.equal(e.message, 'Method \'GET\' already declared for route \'/*\' with constraints \'{}\'')
}
})
test('Method already declared [ignoreTrailingSlash=true]', t => {

@@ -250,0 +276,0 @@ t.plan(2)

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