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 8.2.0 to 9.0.0

lib/null-object.js

16

lib/handler-storage.js
'use strict'
const { NullObject } = require('./null-object')
const httpMethodStrategy = require('./strategies/http-method')

@@ -64,7 +65,16 @@

_compileCreateParamsObject (params) {
const lines = []
const fnBody = []
fnBody.push('const fn = function _createParamsObject (paramsArray) {')
fnBody.push('const params = new NullObject()')
for (let i = 0; i < params.length; i++) {
lines.push(`'${params[i]}': paramsArray[${i}]`)
fnBody.push(`params['${params[i]}'] = paramsArray[${i}]`)
}
return new Function('paramsArray', `return {${lines.join(',')}}`) // eslint-disable-line
fnBody.push('return params')
fnBody.push('}')
fnBody.push('return fn')
return new Function('NullObject', fnBody.join('\n'))(NullObject) // eslint-disable-line
}

@@ -71,0 +81,0 @@

3

lib/strategies/http-method.js

@@ -12,4 +12,5 @@ 'use strict'

},
deriveConstraint: /* istanbul ignore next */ (req) => req.method,
/* c8 ignore next 1 */
deriveConstraint: (req) => req.method,
mustMatchWhenDerived: true
}
{
"name": "find-my-way",
"version": "8.2.0",
"version": "9.0.0",
"description": "Crazy fast http radix based router",

@@ -13,3 +13,3 @@ "main": "index.js",

"test:typescript": "tsd",
"test": "standard && tap -J test/*.test.js && npm run test:typescript",
"test": "standard && tap --allow-incomplete-coverage test/*.test.js && npm run test:typescript",
"test:report": "tap -J test/*.test.js --cov --coverage-report=html --coverage-report=cobertura | tee out.tap",

@@ -39,3 +39,3 @@ "test:reporter": "tap-mocha-reporter xunit < out.tap > test/junit-testresults.xml"

"devDependencies": {
"@types/node": "^14.0.27",
"@types/node": "^20.0.0",
"benchmark": "^2.1.4",

@@ -48,6 +48,6 @@ "chalk": "^4.1.2",

"simple-git": "^3.7.1",
"standard": "^14.3.4",
"tap": "^16.0.1",
"standard": "^17.0.0",
"tap": "^21.0.1",
"tap-mocha-reporter": "^5.0.1",
"tsd": "^0.13.1"
"tsd": "^0.31.0"
},

@@ -57,3 +57,3 @@ "dependencies": {

"fast-querystring": "^1.0.0",
"safe-regex2": "^3.1.0"
"safe-regex2": "^4.0.0"
},

@@ -60,0 +60,0 @@ "tsd": {

@@ -50,3 +50,3 @@ 'use strict'

t.equal(route.store, store)
t.deepEqual(route.params, [])
t.same(route.params, [])

@@ -84,3 +84,3 @@ equalRouters(t, findMyWay, fundMyWayClone)

t.equal(route.handler, handler)
t.deepEqual(route.params, ['param'])
t.same(route.params, ['param'])

@@ -118,3 +118,3 @@ equalRouters(t, findMyWay, fundMyWayClone)

t.equal(route.handler, handler)
t.deepEqual(route.params, ['param'])
t.same(route.params, ['param'])

@@ -150,3 +150,3 @@ equalRouters(t, findMyWay, fundMyWayClone)

t.equal(route.handler, handler)
t.deepEqual(route.params, ['param1'])
t.same(route.params, ['param1'])

@@ -168,3 +168,3 @@ equalRouters(t, findMyWay, fundMyWayClone)

t.equal(route.handler, handler)
t.deepEqual(route.params, ['param1', 'param2'])
t.same(route.params, ['param1', 'param2'])

@@ -200,3 +200,3 @@ equalRouters(t, findMyWay, fundMyWayClone)

t.equal(route.handler, handler)
t.deepEqual(route.params, ['param'])
t.same(route.params, ['param'])

@@ -232,3 +232,3 @@ equalRouters(t, findMyWay, fundMyWayClone)

t.equal(route.handler, handler)
t.deepEqual(route.params, ['*'])
t.same(route.params, ['*'])

@@ -235,0 +235,0 @@ equalRouters(t, findMyWay, fundMyWayClone)

@@ -152,3 +152,3 @@ const t = require('tap')

constrainer._buildDeriveConstraints()
t.sameStrict(constrainer.deriveSyncConstraints, before)
t.same(constrainer.deriveSyncConstraints, before)
})

@@ -199,9 +199,9 @@

storage.set('2.0.0')
t.sameStrict(storage.maxPatches, { '2.0': 0 })
t.same(storage.maxPatches, { '2.0': 0 })
storage.set('2.0.2')
t.sameStrict(storage.maxPatches, { '2.0': 2 })
t.same(storage.maxPatches, { '2.0': 2 })
storage.set('2.0.1')
t.sameStrict(storage.maxPatches, { '2.0': 2 })
t.same(storage.maxPatches, { '2.0': 2 })
})

@@ -233,3 +233,3 @@

const findMyWay = FindMyWay()
t.sameStrict(findMyWay.buildPrettyMeta(), {})
t.same(findMyWay.buildPrettyMeta(), {})
})
import { expectType } from 'tsd'
import * as Router from '../../'
import Router from '../../'
import { Http2ServerRequest, Http2ServerResponse } from 'http2'

@@ -4,0 +4,0 @@ import { IncomingMessage, ServerResponse } from 'http'

Sorry, the diff of this file is not supported yet

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