i18next-http-middleware 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/cjs/httpFunctions.js +1 -1
- package/esm/httpFunctions.js +1 -1
- package/lib/httpFunctions.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
## [v3.1.3](https://github.com/i18next/i18next-http-middleware/compare/v3.1.2...v3.1.3)
|
|
2
|
+
- optimize getQuery() function to check if req.query is iterable
|
|
3
|
+
|
|
1
4
|
## [v3.1.2](https://github.com/i18next/i18next-http-middleware/compare/v3.1.1...v3.1.2)
|
|
2
5
|
- fix the type of the lookup method [#37](https://github.com/i18next/i18next-http-middleware/pull/37)
|
|
3
6
|
|
package/cjs/httpFunctions.js
CHANGED
|
@@ -42,7 +42,7 @@ var getOriginalUrl = function getOriginalUrl(req) {
|
|
|
42
42
|
exports.getOriginalUrl = getOriginalUrl;
|
|
43
43
|
|
|
44
44
|
var getQuery = function getQuery(req) {
|
|
45
|
-
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function') return Object.fromEntries(req.query);
|
|
45
|
+
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function' && typeof req.query[Symbol.iterator] === 'function') return Object.fromEntries(req.query);
|
|
46
46
|
if (req.query) return req.query;
|
|
47
47
|
if (req.raw && req.raw.query) return req.raw.query;
|
|
48
48
|
if (req.ctx && req.ctx.queryParams) return req.ctx.queryParams;
|
package/esm/httpFunctions.js
CHANGED
|
@@ -23,7 +23,7 @@ export var getOriginalUrl = function getOriginalUrl(req) {
|
|
|
23
23
|
return getUrl(req);
|
|
24
24
|
};
|
|
25
25
|
export var getQuery = function getQuery(req) {
|
|
26
|
-
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function') return Object.fromEntries(req.query);
|
|
26
|
+
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function' && typeof req.query[Symbol.iterator] === 'function') return Object.fromEntries(req.query);
|
|
27
27
|
if (req.query) return req.query;
|
|
28
28
|
if (req.raw && req.raw.query) return req.raw.query;
|
|
29
29
|
if (req.ctx && req.ctx.queryParams) return req.ctx.queryParams;
|
package/lib/httpFunctions.js
CHANGED
|
@@ -22,7 +22,7 @@ export const getOriginalUrl = (req) => {
|
|
|
22
22
|
return getUrl(req)
|
|
23
23
|
}
|
|
24
24
|
export const getQuery = (req) => {
|
|
25
|
-
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function') return Object.fromEntries(req.query)
|
|
25
|
+
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function' && typeof req.query[Symbol.iterator] === 'function') return Object.fromEntries(req.query)
|
|
26
26
|
if (req.query) return req.query
|
|
27
27
|
if (req.raw && req.raw.query) return req.raw.query
|
|
28
28
|
if (req.ctx && req.ctx.queryParams) return req.ctx.queryParams
|