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

1

index.d.ts

@@ -122,2 +122,3 @@ import { IncomingMessage, ServerResponse } from 'http';

store: any;
params: string[];
}

@@ -124,0 +125,0 @@

3

index.js

@@ -438,3 +438,4 @@ 'use strict'

handler: existRoute.handler,
store: existRoute.store
store: existRoute.store,
params: existRoute.params || []
}

@@ -441,0 +442,0 @@ }

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

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

@@ -413,3 +413,3 @@ # find-my-way

router.findRoute('GET', '/:file(^\\S+).png')
// => { handler: Function, store: Object }
// => { handler: Function, store: Object, params: ['file'] }

@@ -427,6 +427,6 @@ router.findRoute('GET', '/:file(^\\D+).jpg')

router.findRoute('GET', '/:param1')
// => { handler: Function, store: Object }
// => { handler: Function, store: Object, params: ['param1'] }
router.findRoute('GET', '/:param2')
// => { handler: Function, store: Object }
// => { handler: Function, store: Object, params: ['param1'] }
```

@@ -433,0 +433,0 @@

@@ -13,7 +13,4 @@ 'use strict'

t.strictSame(router1.constrainer.strategies, router2.constrainer.strategies)
t.strictSame(
router1.constrainer.strategies,
router2.constrainer.strategies
)
t.strictSame(
router1.constrainer.strategiesInUse,

@@ -28,3 +25,3 @@ router2.constrainer.strategiesInUse

test('findRoute returns null if there is no routes', t => {
test('findRoute returns null if there is no routes', (t) => {
t.plan(7)

@@ -41,4 +38,4 @@

test('findRoute returns handler and store for a static route', t => {
t.plan(8)
test('findRoute returns handler and store for a static route', (t) => {
t.plan(9)

@@ -56,2 +53,3 @@ const findMyWay = FindMyWay()

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

@@ -61,3 +59,3 @@ equalRouters(t, findMyWay, fundMyWayClone)

test('findRoute returns null for a static route', t => {
test('findRoute returns null for a static route', (t) => {
t.plan(7)

@@ -78,4 +76,4 @@

test('findRoute returns handler for a parametric route', t => {
t.plan(7)
test('findRoute returns handler and params for a parametric route', (t) => {
t.plan(8)

@@ -91,2 +89,3 @@ const findMyWay = FindMyWay()

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

@@ -96,3 +95,3 @@ equalRouters(t, findMyWay, fundMyWayClone)

test('findRoute returns null for a parametric route', t => {
test('findRoute returns null for a parametric route', (t) => {
t.plan(7)

@@ -113,4 +112,4 @@

test('findRoute returns handler for a parametric route with static suffix', t => {
t.plan(7)
test('findRoute returns handler and params for a parametric route with static suffix', (t) => {
t.plan(8)

@@ -126,2 +125,3 @@ const findMyWay = FindMyWay()

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

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

test('findRoute returns null for a parametric route with static suffix', t => {
test('findRoute returns null for a parametric route with static suffix', (t) => {
t.plan(7)

@@ -146,4 +146,4 @@

test('findRoute returns handler even if a param name different', t => {
t.plan(7)
test('findRoute returns handler and original params even if a param name different', (t) => {
t.plan(8)

@@ -159,2 +159,3 @@ const findMyWay = FindMyWay()

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

@@ -164,4 +165,4 @@ equalRouters(t, findMyWay, fundMyWayClone)

test('findRoute returns handler for a multi-parametric route', t => {
t.plan(7)
test('findRoute returns handler and params for a multi-parametric route', (t) => {
t.plan(8)

@@ -177,2 +178,3 @@ const findMyWay = FindMyWay()

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

@@ -182,3 +184,3 @@ equalRouters(t, findMyWay, fundMyWayClone)

test('findRoute returns null for a multi-parametric route', t => {
test('findRoute returns null for a multi-parametric route', (t) => {
t.plan(7)

@@ -197,4 +199,4 @@

test('findRoute returns handler for a regexp route', t => {
t.plan(7)
test('findRoute returns handler and regexp param for a regexp route', (t) => {
t.plan(8)

@@ -210,2 +212,3 @@ const findMyWay = FindMyWay()

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

@@ -215,3 +218,3 @@ equalRouters(t, findMyWay, fundMyWayClone)

test('findRoute returns null for a regexp route', t => {
test('findRoute returns null for a regexp route', (t) => {
t.plan(7)

@@ -230,4 +233,4 @@

test('findRoute returns handler for a wildcard route', t => {
t.plan(7)
test('findRoute returns handler and wildcard param for a wildcard route', (t) => {
t.plan(8)

@@ -243,2 +246,3 @@ const findMyWay = FindMyWay()

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

@@ -248,3 +252,3 @@ equalRouters(t, findMyWay, fundMyWayClone)

test('findRoute returns null for a wildcard route', t => {
test('findRoute returns null for a wildcard route', (t) => {
t.plan(7)

@@ -263,3 +267,3 @@

test('findRoute returns handler for a constrained route', t => {
test('findRoute returns handler for a constrained route', (t) => {
t.plan(9)

@@ -270,3 +274,8 @@

const handler = () => {}
findMyWay.on('GET', '/example', { constraints: { version: '1.0.0' } }, handler)
findMyWay.on(
'GET',
'/example',
{ constraints: { version: '1.0.0' } },
handler
)

@@ -273,0 +282,0 @@ const fundMyWayClone = rfdc(findMyWay)

@@ -57,2 +57,6 @@ import { expectType } from 'tsd'

expectType<Router.FindResult<Router.HTTPVersion.V1> | null>(router.find('GET', '/', {version: '1.0.0'}))
expectType<Router.FindRouteResult<Router.HTTPVersion.V1> | null>(router.findRoute('GET', '/'));
expectType<Router.FindRouteResult<Router.HTTPVersion.V1> | null>(router.findRoute('GET', '/', {}));
expectType<Router.FindRouteResult<Router.HTTPVersion.V1> | null>(router.findRoute('GET', '/', {version: '1.0.0'}));

@@ -59,0 +63,0 @@ expectType<void>(router.reset())

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