find-my-way
Advanced tools
Comparing version 7.2.0 to 7.2.1
@@ -270,2 +270,6 @@ 'use strict' | ||
parentNodePathIndex = i + 1 | ||
if (i !== path.length - 1) { | ||
throw new Error('Wildcard must be the last character in the route') | ||
} | ||
} | ||
@@ -272,0 +276,0 @@ } |
{ | ||
"name": "find-my-way", | ||
"version": "7.2.0", | ||
"version": "7.2.1", | ||
"description": "Crazy fast http radix based router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -604,1 +604,17 @@ 'use strict' | ||
}) | ||
test('Wildcard must be the last character in the route', (t) => { | ||
t.plan(6) | ||
const expectedError = new Error('Wildcard must be the last character in the route') | ||
const findMyWay = FindMyWay() | ||
t.throws(() => findMyWay.on('GET', '*1', () => {}), expectedError) | ||
t.throws(() => findMyWay.on('GET', '*/', () => {}), expectedError) | ||
t.throws(() => findMyWay.on('GET', '*?', () => {}), expectedError) | ||
t.throws(() => findMyWay.on('GET', '/foo*123', () => {}), expectedError) | ||
t.throws(() => findMyWay.on('GET', '/foo*?', () => {}), expectedError) | ||
t.throws(() => findMyWay.on('GET', '/foo*/', () => {}), expectedError) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
318437
7925