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 1.0.2 to 1.0.3

20

cjs/languageLookups/querystring.js

@@ -18,4 +18,20 @@ "use strict";

if (!found && options.getUrl(req) && options.getUrl(req).indexOf('?')) {
var urlParams = new URLSearchParams(options.getUrl(req).substring(options.getUrl(req).indexOf('?')));
found = urlParams.get(options.lookupQuerystring);
var lastPartOfUri = options.getUrl(req).substring(options.getUrl(req).indexOf('?'));
if (typeof URLSearchParams !== 'undefined') {
var urlParams = new URLSearchParams(lastPartOfUri);
found = urlParams.get(options.lookupQuerystring);
} else {
var indexOfQsStart = lastPartOfUri.indexOf("".concat(options.lookupQuerystring, "="));
if (indexOfQsStart > -1) {
var restOfUri = lastPartOfUri.substring(options.lookupQuerystring.length + 2);
if (restOfUri.indexOf('&') < 0) {
found = restOfUri;
} else {
found = restOfUri.substring(0, restOfUri.indexOf('&'));
}
}
}
}

@@ -22,0 +38,0 @@ }

@@ -12,4 +12,17 @@ export default {

if (!found && options.getUrl(req) && options.getUrl(req).indexOf('?')) {
const urlParams = new URLSearchParams(options.getUrl(req).substring(options.getUrl(req).indexOf('?')))
found = urlParams.get(options.lookupQuerystring)
const lastPartOfUri = options.getUrl(req).substring(options.getUrl(req).indexOf('?'))
if (typeof URLSearchParams !== 'undefined') {
const urlParams = new URLSearchParams(lastPartOfUri)
found = urlParams.get(options.lookupQuerystring)
} else {
const indexOfQsStart = lastPartOfUri.indexOf(`${options.lookupQuerystring}=`)
if (indexOfQsStart > -1) {
const restOfUri = lastPartOfUri.substring(options.lookupQuerystring.length + 2)
if (restOfUri.indexOf('&') < 0) {
found = restOfUri
} else {
found = restOfUri.substring(0, restOfUri.indexOf('&'))
}
}
}
}

@@ -16,0 +29,0 @@ }

2

package.json
{
"name": "i18next-http-middleware",
"version": "1.0.2",
"version": "1.0.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