Socket
Socket
Sign inDemoInstall

next-i18next

Package Overview
Dependencies
Maintainers
1
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-i18next - npm Package Compare versions

Comparing version 0.15.0 to 0.16.0

7

dist/utils/force-trailing-slash.js

@@ -15,8 +15,13 @@ "use strict";

var performedRedirect = false;
req.i18n.options.allLanguages.forEach(function (lng) {
if (pathname === "/".concat(lng)) {
res.redirect(301, pathname.replace("/".concat(lng), "/".concat(lng, "/")) + (search || ''));
performedRedirect = true;
}
});
next();
if (!performedRedirect) {
next();
}
};

@@ -23,0 +28,0 @@

11

dist/utils/lng-path-detector.js

@@ -28,8 +28,13 @@ "use strict";

language is not set to default, give
preference to the path and reset their
language.
preference to the language and redirect
their path.
*/
if (language !== defaultLanguage && !req.url.startsWith("/".concat(language, "/"))) {
req.i18n.changeLanguage(defaultLanguage);
allLanguages.forEach(function (lng) {
if (req.url.startsWith("/".concat(lng, "/"))) {
req.url = req.url.replace("/".concat(lng, "/"), '/');
}
});
res.redirect(301, req.url.replace('/', "/".concat(language, "/")));
}

@@ -36,0 +41,0 @@ /*

{
"name": "next-i18next",
"version": "0.15.0",
"version": "0.16.0",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "repository": "git@github.com:isaachinman/next-i18next.git",

@@ -160,6 +160,2 @@ # next-i18next

## Contributing
Please do! All PRs and issues will be thoroughly reviewed.
## Contributors

@@ -166,0 +162,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