Socket
Socket
Sign inDemoInstall

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.1 to 8.2.2

.taprc

16

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

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

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

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

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

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

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

"test:typescript": "tsd",
"test": "standard && tap --allow-incomplete-coverage test/*.test.js && npm run test:typescript",
"test": "standard && tap -J 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": "^20.0.0",
"@types/node": "^14.0.27",
"benchmark": "^2.1.4",

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

const findMyWay = FindMyWay()
t.same(findMyWay.buildPrettyMeta(), {})
t.sameStrict(findMyWay.buildPrettyMeta(), {})
})

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

findMyWay.on('GET', '/:foo-:bar-', (req, res, params) => {})
findMyWay.find('GET', '/' + '-'.repeat(16_000) + 'a', { host: 'fastify.io' })
findMyWay.find('GET', '/' + '-'.repeat(16000) + 'a', { host: 'fastify.io' })
})
import { expectType } from 'tsd'
import Router from '../../'
import * as 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