Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

i18next-http-middleware

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18next-http-middleware - npm Package Compare versions

Comparing version 3.1.2 to 3.1.3

3

CHANGELOG.md

@@ -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)

2

cjs/httpFunctions.js

@@ -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",

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