Comparing version 3.3.0 to 3.4.0
@@ -29,3 +29,3 @@ const Trouter = require('trouter') | ||
const isCacheEnabled = config.cacheSize > 0 | ||
const cache = isCacheEnabled ? new LRU(config.cacheSize) : null | ||
const cache = isCacheEnabled ? new LRU({ max: config.cacheSize }) : null | ||
const router = new Trouter() | ||
@@ -32,0 +32,0 @@ router.id = config.id |
@@ -1,18 +0,16 @@ | ||
const qs = require('querystring') | ||
module.exports = (req, url) => { | ||
const [path, search] = url.split('?') | ||
req.path = path | ||
switch (search) { | ||
case undefined: | ||
case '': { | ||
req.search = '?' | ||
req.query = {} | ||
break | ||
const [path, search = ''] = url.split('?') | ||
const searchParams = new URLSearchParams(search.replaceAll('[]=', '=')) | ||
const query = {} | ||
for (const [name, value] of searchParams.entries()) { | ||
if (query[name]) { | ||
Array.isArray(query[name]) | ||
? query[name].push(value) | ||
: (query[name] = [query[name], value]) | ||
} else { | ||
query[name] = value | ||
} | ||
default: { | ||
req.search = '?' + search | ||
req.query = qs.parse(search.replace(/\[\]=/g, '=')) | ||
} | ||
} | ||
req.path = path | ||
req.query = query | ||
} |
{ | ||
"name": "0http", | ||
"version": "v3.3.0", | ||
"version": "v3.4.0", | ||
"description": "Cero friction HTTP request router. The need for speed!", | ||
@@ -46,3 +46,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"lru-cache": "^6.0.0", | ||
"lru-cache": "^7.10.1", | ||
"regexparam": "^2.0.0", | ||
@@ -49,0 +49,0 @@ "trouter": "^3.2.0" |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
8706
172
+ Addedlru-cache@7.18.3(transitive)
- Removedlru-cache@6.0.0(transitive)
- Removedyallist@4.0.0(transitive)
Updatedlru-cache@^7.10.1