i18next-http-middleware 3.1.1 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/LanguageDetector.js +5 -4
- package/cjs/httpFunctions.js +2 -2
- package/cjs/index.js +11 -7
- package/cjs/languageLookups/session.js +1 -1
- package/cjs/utils.js +1 -1
- package/esm/LanguageDetector.js +2 -1
- package/esm/httpFunctions.js +1 -1
- package/esm/index.js +3 -0
- package/esm/languageLookups/session.js +1 -1
- package/index.d.ts +1 -1
- package/lib/LanguageDetector.js +1 -1
- package/lib/httpFunctions.js +1 -1
- package/lib/index.js +3 -0
- package/licence +1 -1
- package/package.json +17 -22
- package/CHANGELOG.md +0 -39
package/cjs/LanguageDetector.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -23,15 +23,15 @@ var _httpFunctions = require("./httpFunctions.js");
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
27
|
|
|
28
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
|
|
30
30
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
31
31
|
|
|
32
32
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
33
33
|
|
|
34
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
34
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
35
|
|
|
36
36
|
function getDefaults() {
|
|
37
37
|
return (0, _httpFunctions.extendOptionsWithDefaults)({
|
|
@@ -117,6 +117,7 @@ var LanguageDetector = function () {
|
|
|
117
117
|
|
|
118
118
|
if (!found) {
|
|
119
119
|
var fallbacks = this.allOptions.fallbackLng;
|
|
120
|
+
if (typeof fallbacks === 'function') fallbacks = fallbacks();
|
|
120
121
|
if (typeof fallbacks === 'string') fallbacks = [fallbacks];
|
|
121
122
|
if (!fallbacks) fallbacks = [];
|
|
122
123
|
|
package/cjs/httpFunctions.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.setUrl = exports.setStatus = exports.setHeader = exports.setContentType = exports.send = exports.getUrl = exports.getSession = exports.getQuery = exports.getPath = exports.getParams = exports.getOriginalUrl = exports.getHeaders = exports.getHeader = exports.getCookies = exports.getBody = exports.extendOptionsWithDefaults = void 0;
|
|
7
7
|
|
|
8
8
|
var getPath = function getPath(req) {
|
|
9
9
|
if (req.path) return req.path;
|
|
@@ -42,7 +42,7 @@ var getOriginalUrl = function getOriginalUrl(req) {
|
|
|
42
42
|
exports.getOriginalUrl = getOriginalUrl;
|
|
43
43
|
|
|
44
44
|
var getQuery = function getQuery(req) {
|
|
45
|
-
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function') return Object.fromEntries(req.query);
|
|
45
|
+
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function' && typeof req.query[Symbol.iterator] === 'function') return Object.fromEntries(req.query);
|
|
46
46
|
if (req.query) return req.query;
|
|
47
47
|
if (req.raw && req.raw.query) return req.raw.query;
|
|
48
48
|
if (req.ctx && req.ctx.queryParams) return req.ctx.queryParams;
|
package/cjs/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
8
|
+
exports.LanguageDetector = void 0;
|
|
9
|
+
exports.addRoute = addRoute;
|
|
10
|
+
exports.default = void 0;
|
|
10
11
|
exports.getResourcesHandler = getResourcesHandler;
|
|
12
|
+
exports.handle = handle;
|
|
11
13
|
exports.missingKeyHandler = missingKeyHandler;
|
|
12
|
-
exports.
|
|
13
|
-
exports.default = exports.LanguageDetector = void 0;
|
|
14
|
+
exports.plugin = plugin;
|
|
14
15
|
|
|
15
16
|
var utils = _interopRequireWildcard(require("./utils.js"));
|
|
16
17
|
|
|
@@ -20,9 +21,9 @@ var _httpFunctions = require("./httpFunctions.js");
|
|
|
20
21
|
|
|
21
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
23
|
|
|
23
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
25
|
|
|
25
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
27
|
|
|
27
28
|
var LanguageDetector = _LanguageDetector.default;
|
|
28
29
|
exports.LanguageDetector = LanguageDetector;
|
|
@@ -73,6 +74,7 @@ function handle(i18next) {
|
|
|
73
74
|
});
|
|
74
75
|
i18n.on('languageChanged', function (lng) {
|
|
75
76
|
req.language = req.locale = req.lng = lng;
|
|
77
|
+
if (options.attachLocals) res.locals = res.locals || {};
|
|
76
78
|
|
|
77
79
|
if (res.locals) {
|
|
78
80
|
res.locals.language = lng;
|
|
@@ -108,6 +110,7 @@ function handle(i18next) {
|
|
|
108
110
|
var exists = i18n.exists.bind(i18n);
|
|
109
111
|
req.i18n = i18n;
|
|
110
112
|
req.t = t;
|
|
113
|
+
if (options.attachLocals) res.locals = res.locals || {};
|
|
111
114
|
|
|
112
115
|
if (res.locals) {
|
|
113
116
|
res.locals.t = t;
|
|
@@ -126,6 +129,7 @@ function handle(i18next) {
|
|
|
126
129
|
}
|
|
127
130
|
|
|
128
131
|
function plugin(instance, options, next) {
|
|
132
|
+
options.attachLocals = true;
|
|
129
133
|
var middleware = handle(options.i18next, options);
|
|
130
134
|
instance.addHook('preHandler', function (request, reply, next) {
|
|
131
135
|
return middleware(request, reply, next);
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
8
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
9
9
|
|
|
10
10
|
var _default = {
|
|
11
11
|
name: 'session',
|
package/cjs/utils.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.setPath = setPath;
|
|
7
6
|
exports.defaults = defaults;
|
|
8
7
|
exports.extend = extend;
|
|
9
8
|
exports.removeLngFromUrl = removeLngFromUrl;
|
|
9
|
+
exports.setPath = setPath;
|
|
10
10
|
|
|
11
11
|
function setPath(object, path, newValue) {
|
|
12
12
|
var stack;
|
package/esm/LanguageDetector.js
CHANGED
|
@@ -2,7 +2,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
2
2
|
|
|
3
3
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
4
4
|
|
|
5
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
6
|
|
|
7
7
|
import * as utils from './utils.js';
|
|
8
8
|
import cookieLookup from './languageLookups/cookie.js';
|
|
@@ -96,6 +96,7 @@ var LanguageDetector = function () {
|
|
|
96
96
|
|
|
97
97
|
if (!found) {
|
|
98
98
|
var fallbacks = this.allOptions.fallbackLng;
|
|
99
|
+
if (typeof fallbacks === 'function') fallbacks = fallbacks();
|
|
99
100
|
if (typeof fallbacks === 'string') fallbacks = [fallbacks];
|
|
100
101
|
if (!fallbacks) fallbacks = [];
|
|
101
102
|
|
package/esm/httpFunctions.js
CHANGED
|
@@ -23,7 +23,7 @@ export var getOriginalUrl = function getOriginalUrl(req) {
|
|
|
23
23
|
return getUrl(req);
|
|
24
24
|
};
|
|
25
25
|
export var getQuery = function getQuery(req) {
|
|
26
|
-
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function') return Object.fromEntries(req.query);
|
|
26
|
+
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function' && typeof req.query[Symbol.iterator] === 'function') return Object.fromEntries(req.query);
|
|
27
27
|
if (req.query) return req.query;
|
|
28
28
|
if (req.raw && req.raw.query) return req.raw.query;
|
|
29
29
|
if (req.ctx && req.ctx.queryParams) return req.ctx.queryParams;
|
package/esm/index.js
CHANGED
|
@@ -49,6 +49,7 @@ export function handle(i18next) {
|
|
|
49
49
|
});
|
|
50
50
|
i18n.on('languageChanged', function (lng) {
|
|
51
51
|
req.language = req.locale = req.lng = lng;
|
|
52
|
+
if (options.attachLocals) res.locals = res.locals || {};
|
|
52
53
|
|
|
53
54
|
if (res.locals) {
|
|
54
55
|
res.locals.language = lng;
|
|
@@ -84,6 +85,7 @@ export function handle(i18next) {
|
|
|
84
85
|
var exists = i18n.exists.bind(i18n);
|
|
85
86
|
req.i18n = i18n;
|
|
86
87
|
req.t = t;
|
|
88
|
+
if (options.attachLocals) res.locals = res.locals || {};
|
|
87
89
|
|
|
88
90
|
if (res.locals) {
|
|
89
91
|
res.locals.t = t;
|
|
@@ -101,6 +103,7 @@ export function handle(i18next) {
|
|
|
101
103
|
};
|
|
102
104
|
}
|
|
103
105
|
export function plugin(instance, options, next) {
|
|
106
|
+
options.attachLocals = true;
|
|
104
107
|
var middleware = handle(options.i18next, options);
|
|
105
108
|
instance.addHook('preHandler', function (request, reply, next) {
|
|
106
109
|
return middleware(request, reply, next);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
name: 'session',
|
package/index.d.ts
CHANGED
package/lib/LanguageDetector.js
CHANGED
|
@@ -79,9 +79,9 @@ class LanguageDetector {
|
|
|
79
79
|
|
|
80
80
|
if (!found) {
|
|
81
81
|
let fallbacks = this.allOptions.fallbackLng
|
|
82
|
+
if (typeof fallbacks === 'function') fallbacks = fallbacks()
|
|
82
83
|
if (typeof fallbacks === 'string') fallbacks = [fallbacks]
|
|
83
84
|
if (!fallbacks) fallbacks = []
|
|
84
|
-
|
|
85
85
|
if (Object.prototype.toString.apply(fallbacks) === '[object Array]') {
|
|
86
86
|
found = fallbacks[0]
|
|
87
87
|
} else {
|
package/lib/httpFunctions.js
CHANGED
|
@@ -22,7 +22,7 @@ export const getOriginalUrl = (req) => {
|
|
|
22
22
|
return getUrl(req)
|
|
23
23
|
}
|
|
24
24
|
export const getQuery = (req) => {
|
|
25
|
-
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function') return Object.fromEntries(req.query)
|
|
25
|
+
if (req.query && typeof req.query.entries === 'function' && typeof Object.fromEntries === 'function' && typeof req.query[Symbol.iterator] === 'function') return Object.fromEntries(req.query)
|
|
26
26
|
if (req.query) return req.query
|
|
27
27
|
if (req.raw && req.raw.query) return req.raw.query
|
|
28
28
|
if (req.ctx && req.ctx.queryParams) return req.ctx.queryParams
|
package/lib/index.js
CHANGED
|
@@ -40,6 +40,7 @@ export function handle (i18next, options = {}) {
|
|
|
40
40
|
i18n.on('languageChanged', (lng) => { // Keep language in sync
|
|
41
41
|
req.language = req.locale = req.lng = lng
|
|
42
42
|
|
|
43
|
+
if (options.attachLocals) res.locals = res.locals || {}
|
|
43
44
|
if (res.locals) {
|
|
44
45
|
res.locals.language = lng
|
|
45
46
|
res.locals.languageDir = i18next.dir(lng)
|
|
@@ -81,6 +82,7 @@ export function handle (i18next, options = {}) {
|
|
|
81
82
|
req.t = t
|
|
82
83
|
|
|
83
84
|
// assert for res -> template
|
|
85
|
+
if (options.attachLocals) res.locals = res.locals || {}
|
|
84
86
|
if (res.locals) {
|
|
85
87
|
res.locals.t = t
|
|
86
88
|
res.locals.exists = exists
|
|
@@ -97,6 +99,7 @@ export function handle (i18next, options = {}) {
|
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
export function plugin (instance, options, next) {
|
|
102
|
+
options.attachLocals = true
|
|
100
103
|
const middleware = handle(options.i18next, options)
|
|
101
104
|
instance.addHook('preHandler', (request, reply, next) => middleware(request, reply, next))
|
|
102
105
|
return next()
|
package/licence
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "i18next-http-middleware",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./cjs/index.js",
|
|
@@ -21,26 +21,26 @@
|
|
|
21
21
|
"module": "./esm/index.js",
|
|
22
22
|
"dependencies": {},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@babel/cli": "7.
|
|
25
|
-
"@babel/core": "7.
|
|
26
|
-
"@babel/preset-env": "7.
|
|
27
|
-
"@types/express-serve-static-core": "^4.17.
|
|
24
|
+
"@babel/cli": "7.16.0",
|
|
25
|
+
"@babel/core": "7.16.5",
|
|
26
|
+
"@babel/preset-env": "7.16.5",
|
|
27
|
+
"@types/express-serve-static-core": "^4.17.27",
|
|
28
28
|
"babel-plugin-add-module-exports": "1.0.4",
|
|
29
|
-
"eslint": "7.
|
|
30
|
-
"eslint-config-standard": "16.0.
|
|
31
|
-
"eslint-plugin-import": "2.
|
|
29
|
+
"eslint": "7.29.0",
|
|
30
|
+
"eslint-config-standard": "16.0.3",
|
|
31
|
+
"eslint-plugin-import": "2.25.3",
|
|
32
32
|
"eslint-plugin-node": "11.1.0",
|
|
33
|
-
"eslint-plugin-promise": "
|
|
33
|
+
"eslint-plugin-promise": "5.1.0",
|
|
34
34
|
"eslint-plugin-require-path-exists": "1.1.9",
|
|
35
35
|
"eslint-plugin-standard": "5.0.0",
|
|
36
36
|
"expect.js": "0.3.1",
|
|
37
|
-
"express": "4.17.
|
|
38
|
-
"fastify": "3.
|
|
39
|
-
"i18next": "
|
|
40
|
-
"mocha": "
|
|
41
|
-
"supertest": "6.
|
|
42
|
-
"tsd": "0.
|
|
43
|
-
"uglify-js": "3.
|
|
37
|
+
"express": "4.17.2",
|
|
38
|
+
"fastify": "3.25.2",
|
|
39
|
+
"i18next": "21.6.3",
|
|
40
|
+
"mocha": "9.1.3",
|
|
41
|
+
"supertest": "6.1.6",
|
|
42
|
+
"tsd": "0.19.0",
|
|
43
|
+
"uglify-js": "3.14.5"
|
|
44
44
|
},
|
|
45
45
|
"description": "i18next-http-middleware is a middleware to be used with Node.js web frameworks like express or Fastify and also for Deno.",
|
|
46
46
|
"keywords": [
|
|
@@ -57,12 +57,7 @@
|
|
|
57
57
|
"bugs": {
|
|
58
58
|
"url": "https://github.com/i18next/i18next-http-middleware/issues"
|
|
59
59
|
},
|
|
60
|
-
"
|
|
61
|
-
{
|
|
62
|
-
"type": "MIT",
|
|
63
|
-
"url": "https://raw.github.com/i18next/i18next-http-middleware/master/licence"
|
|
64
|
-
}
|
|
65
|
-
],
|
|
60
|
+
"license": "MIT",
|
|
66
61
|
"scripts": {
|
|
67
62
|
"lint": "eslint .",
|
|
68
63
|
"compile:esm": "rm -rf esm && mkdir esm && BABEL_ENV=esm babel lib -d esm",
|
package/CHANGELOG.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
## [v3.1.1](https://github.com/i18next/i18next-http-middleware/compare/v3.1.0...v3.1.1)
|
|
2
|
-
- make sure no undefined language is detected
|
|
3
|
-
|
|
4
|
-
## [v3.1.0](https://github.com/i18next/i18next-http-middleware/compare/v3.0.6...v3.1.0)
|
|
5
|
-
- added types
|
|
6
|
-
|
|
7
|
-
## [v3.0.6](https://github.com/i18next/i18next-http-middleware/compare/v3.0.5...v3.0.6)
|
|
8
|
-
- ignoreCase option true by default
|
|
9
|
-
|
|
10
|
-
## [v3.0.5](https://github.com/i18next/i18next-http-middleware/compare/v3.0.4...v3.0.5)
|
|
11
|
-
- introduce ignoreCase option
|
|
12
|
-
|
|
13
|
-
## [v3.0.4](https://github.com/i18next/i18next-http-middleware/compare/v3.0.3...v3.0.4)
|
|
14
|
-
- fix language detection algorithm to handle fallbackLng correctly
|
|
15
|
-
|
|
16
|
-
## [v3.0.3](https://github.com/i18next/i18next-http-middleware/compare/v3.0.2...v3.0.3)
|
|
17
|
-
- prevent URIError with cookie language detector
|
|
18
|
-
|
|
19
|
-
## [v3.0.2](https://github.com/i18next/i18next-http-middleware/compare/v3.0.1...v3.0.2)
|
|
20
|
-
- transpile also esm
|
|
21
|
-
|
|
22
|
-
## [v3.0.1](https://github.com/i18next/i18next-http-middleware/compare/v3.0.0...v3.0.1)
|
|
23
|
-
- introduce lookupHeaderRegex option
|
|
24
|
-
|
|
25
|
-
## [v3.0.0](https://github.com/i18next/i18next-http-middleware/compare/v2.1.2...v3.0.0)
|
|
26
|
-
- **BREAKING** needs i18next >= 19.5.0
|
|
27
|
-
- let i18next figure out which detected lng is best match
|
|
28
|
-
|
|
29
|
-
## [v2.1.2](https://github.com/i18next/i18next-http-middleware/compare/v2.1.1...v2.1.2)
|
|
30
|
-
- fix: get whitelist from correct property
|
|
31
|
-
|
|
32
|
-
## [v2.1.1](https://github.com/i18next/i18next-http-middleware/compare/v2.1.0...v2.1.1)
|
|
33
|
-
- extend httpFunctions getQuery to handle some edge cases
|
|
34
|
-
|
|
35
|
-
## [v2.1.0](https://github.com/i18next/i18next-http-middleware/compare/v2.0.0...v2.1.0)
|
|
36
|
-
- LanguageDetector: cookie, new option: cookiePath
|
|
37
|
-
|
|
38
|
-
## [v2.0.0](https://github.com/i18next/i18next-http-middleware/compare/v1.3.1...v2.0.0)
|
|
39
|
-
- potentially BREAKING: change cookie defaults: cookieSameSite: 'strict'
|