i18next-express-middleware
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -32,6 +32,6 @@ 'use strict'; | ||
return function (req, res, next) { | ||
var ignores = options.ignoreRoutes || []; | ||
ignores.forEach(function (ignore) { | ||
if (req.path.indexOf(ignore) > -1) return next(); | ||
}); | ||
var ignores = options.ignoreRoutes instanceof Array && options.ignoreRoutes || []; | ||
for (var i = 0; i < ignores.length; i++) { | ||
if (req.path.indexOf(ignores[i]) > -1) return next(); | ||
} | ||
@@ -73,3 +73,4 @@ var lng = req.lng; | ||
changeLanguage: function changeLanguage(lng) { | ||
req.lng = lng; | ||
req.language = req.locale = req.lng = lng; | ||
req.languages = i18next.services.languageUtils.toResolveHierarchy(lng); | ||
}, | ||
@@ -76,0 +77,0 @@ language: lng |
{ | ||
"name": "i18next-express-middleware", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "express middleware for i18next", | ||
@@ -19,11 +19,11 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"cookies": "0.5.1", | ||
"cookies": "0.6.1", | ||
"json5": "0.4.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "6.0.0", | ||
"babel-core": "6.4.5", | ||
"babel-eslint": "5.0.0-beta6", | ||
"babel-cli": "6.5.1", | ||
"babel-core": "6.5.2", | ||
"babel-eslint": "5.0.0", | ||
"babel-preset-es2015": "6.3.13", | ||
"babel-preset-stage-0": "6.3.13", | ||
"babel-preset-stage-0": "6.5.0", | ||
"chai": "2.3.0", | ||
@@ -30,0 +30,0 @@ "eslint": "1.2.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22727
419
+ Addedcookies@0.6.1(transitive)
+ Addeddepd@1.1.2(transitive)
- Removedcookies@0.5.1(transitive)
Updatedcookies@0.6.1