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.5.0 to 3.6.0

5

cjs/index.d.ts

@@ -118,2 +118,7 @@ import {

cookieDomain?: string;
/**
* optional conversion function to use to modify the detected language code
*/
convertDetectedLanguage?: 'Iso15897' | ((lng: string) => string);
}

@@ -120,0 +125,0 @@ interface LanguageDetectorAllOptions {

13

cjs/LanguageDetector.js

@@ -32,3 +32,6 @@ "use strict";

cookieSameSite: 'strict',
ignoreCase: true
ignoreCase: true,
convertDetectedLanguage: function convertDetectedLanguage(l) {
return l;
}
});

@@ -53,2 +56,7 @@ }

this.allOptions = allOptions;
if (typeof this.options.convertDetectedLanguage === 'string' && this.options.convertDetectedLanguage.indexOf('15897') > -1) {
this.options.convertDetectedLanguage = function (l) {
return l.replace('-', '_');
};
}
this.addDetector(_cookie.default);

@@ -80,2 +88,5 @@ this.addDetector(_querystring.default);

});
detections = detections.map(function (d) {
return _this.options.convertDetectedLanguage(d);
});
if (_this.services.languageUtils.getBestMatchFromCodes) {

@@ -82,0 +93,0 @@ found = _this.services.languageUtils.getBestMatchFromCodes(detections);

@@ -118,2 +118,7 @@ import {

cookieDomain?: string;
/**
* optional conversion function to use to modify the detected language code
*/
convertDetectedLanguage?: 'Iso15897' | ((lng: string) => string);
}

@@ -120,0 +125,0 @@ interface LanguageDetectorAllOptions {

@@ -23,3 +23,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }

cookieSameSite: 'strict',
ignoreCase: true
ignoreCase: true,
convertDetectedLanguage: function convertDetectedLanguage(l) {
return l;
}
});

@@ -44,2 +47,7 @@ }

this.allOptions = allOptions;
if (typeof this.options.convertDetectedLanguage === 'string' && this.options.convertDetectedLanguage.indexOf('15897') > -1) {
this.options.convertDetectedLanguage = function (l) {
return l.replace('-', '_');
};
}
this.addDetector(cookieLookup);

@@ -71,2 +79,5 @@ this.addDetector(querystringLookup);

});
detections = detections.map(function (d) {
return _this.options.convertDetectedLanguage(d);
});
if (_this.services.languageUtils.getBestMatchFromCodes) {

@@ -73,0 +84,0 @@ found = _this.services.languageUtils.getBestMatchFromCodes(detections);

@@ -118,2 +118,7 @@ import {

cookieDomain?: string;
/**
* optional conversion function to use to modify the detected language code
*/
convertDetectedLanguage?: 'Iso15897' | ((lng: string) => string);
}

@@ -120,0 +125,0 @@ interface LanguageDetectorAllOptions {

@@ -23,3 +23,5 @@ import * as utils from './utils.js'

cookieSameSite: 'strict',
ignoreCase: true
ignoreCase: true,
convertDetectedLanguage: (l) => l
})

@@ -41,2 +43,6 @@ }

if (typeof this.options.convertDetectedLanguage === 'string' && this.options.convertDetectedLanguage.indexOf('15897') > -1) {
this.options.convertDetectedLanguage = (l) => l.replace('-', '_')
}
this.addDetector(cookieLookup)

@@ -66,2 +72,3 @@ this.addDetector(querystringLookup)

detections = detections.filter((d) => d !== undefined && d !== null)
detections = detections.map((d) => this.options.convertDetectedLanguage(d))

@@ -68,0 +75,0 @@ if (this.services.languageUtils.getBestMatchFromCodes) { // new i18next v19.5.0

4

package.json
{
"name": "i18next-http-middleware",
"version": "3.5.0",
"version": "3.6.0",
"private": false,

@@ -47,3 +47,3 @@ "type": "module",

"expect.js": "0.3.1",
"express": "4.18.2",
"express": "4.19.2",
"fastify": "4.24.3",

@@ -50,0 +50,0 @@ "i18next": "23.7.1",

@@ -401,3 +401,7 @@ # Introduction

cookieSecure: true, // if need secure cookie
cookieSameSite: 'strict' // 'strict', 'lax' or 'none'
cookieSameSite: 'strict', // 'strict', 'lax' or 'none'
// optional conversion function used to modify the detected language code
convertDetectedLanguage: 'Iso15897',
convertDetectedLanguage: (lng) => lng.replace('-', '_')
}

@@ -404,0 +408,0 @@ ```

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