i18next-http-middleware
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -0,1 +1,4 @@ | ||
## [v3.1.3](https://github.com/i18next/i18next-http-middleware/compare/v3.1.2...v3.1.3) | ||
- optimize getQuery() function to check if req.query is iterable | ||
## [v3.1.2](https://github.com/i18next/i18next-http-middleware/compare/v3.1.1...v3.1.2) | ||
@@ -2,0 +5,0 @@ - fix the type of the lookup method [#37](https://github.com/i18next/i18next-http-middleware/pull/37) |
@@ -45,3 +45,3 @@ "use strict"; | ||
var getQuery = function getQuery(req) { | ||
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function') return Object.fromEntries(req.query); | ||
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function' && typeof req.query[Symbol.iterator] === 'function') return Object.fromEntries(req.query); | ||
if (req.query) return req.query; | ||
@@ -48,0 +48,0 @@ if (req.raw && req.raw.query) return req.raw.query; |
@@ -26,3 +26,3 @@ export var getPath = function getPath(req) { | ||
export var getQuery = function getQuery(req) { | ||
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function') return Object.fromEntries(req.query); | ||
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function' && typeof req.query[Symbol.iterator] === 'function') return Object.fromEntries(req.query); | ||
if (req.query) return req.query; | ||
@@ -29,0 +29,0 @@ if (req.raw && req.raw.query) return req.raw.query; |
@@ -25,3 +25,3 @@ export const getPath = (req) => { | ||
export const getQuery = (req) => { | ||
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function') return Object.fromEntries(req.query) | ||
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function' && typeof req.query[Symbol.iterator] === 'function') return Object.fromEntries(req.query) | ||
if (req.query) return req.query | ||
@@ -28,0 +28,0 @@ if (req.raw && req.raw.query) return req.raw.query |
{ | ||
"name": "i18next-http-middleware", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "type": "module", |
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
101962