@os-team/i18next-express-middleware
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -1,4 +0,22 @@ | ||
export { default as i18nextMiddleware } from './utils/i18nextMiddleware'; | ||
export { default as LanguageDetector } from './utils/LanguageDetector'; | ||
export * from './utils/types'; | ||
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LanguageDetector = exports.i18nextMiddleware = void 0; | ||
var i18nextMiddleware_1 = require("./utils/i18nextMiddleware"); | ||
Object.defineProperty(exports, "i18nextMiddleware", { enumerable: true, get: function () { return __importDefault(i18nextMiddleware_1).default; } }); | ||
var LanguageDetector_1 = require("./utils/LanguageDetector"); | ||
Object.defineProperty(exports, "LanguageDetector", { enumerable: true, get: function () { return __importDefault(LanguageDetector_1).default; } }); | ||
__exportStar(require("./utils/types"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const cookieDetector = { | ||
@@ -8,3 +10,3 @@ name: 'cookie', | ||
}; | ||
export default cookieDetector; | ||
exports.default = cookieDetector; | ||
//# sourceMappingURL=cookieDetector.js.map |
@@ -0,1 +1,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const headerDetector = { | ||
@@ -19,3 +21,3 @@ name: 'header', | ||
}; | ||
export default headerDetector; | ||
exports.default = headerDetector; | ||
//# sourceMappingURL=headerDetector.js.map |
@@ -0,1 +1,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const getFallbackLng = (value) => { | ||
@@ -10,3 +12,3 @@ if (typeof value === 'string') | ||
}; | ||
export default getFallbackLng; | ||
exports.default = getFallbackLng; | ||
//# sourceMappingURL=getFallbackLng.js.map |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -10,3 +11,7 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
}; | ||
import getFallbackLng from './getFallbackLng'; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const getFallbackLng_1 = __importDefault(require("./getFallbackLng")); | ||
const i18nextMiddleware = (i18next) => (req, _, next) => __awaiter(void 0, void 0, void 0, function* () { | ||
@@ -18,3 +23,3 @@ const clonedI18next = i18next.cloneInstance({ initImmediate: false }); | ||
: undefined; | ||
const lng = detectedLanguage || getFallbackLng(i18next.options.fallbackLng); | ||
const lng = detectedLanguage || getFallbackLng_1.default(i18next.options.fallbackLng); | ||
if (clonedI18next.language !== lng) | ||
@@ -28,3 +33,3 @@ yield clonedI18next.changeLanguage(lng); | ||
}); | ||
export default i18nextMiddleware; | ||
exports.default = i18nextMiddleware; | ||
//# sourceMappingURL=i18nextMiddleware.js.map |
@@ -1,3 +0,8 @@ | ||
import headerDetector from './detectors/headerDetector'; | ||
import cookieDetector from './detectors/cookieDetector'; | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const headerDetector_1 = __importDefault(require("./detectors/headerDetector")); | ||
const cookieDetector_1 = __importDefault(require("./detectors/cookieDetector")); | ||
class LanguageDetector { | ||
@@ -14,4 +19,4 @@ constructor() { | ||
this.detectorOptions = detectorOptions; | ||
this.addDetector(headerDetector); | ||
this.addDetector(cookieDetector); | ||
this.addDetector(headerDetector_1.default); | ||
this.addDetector(cookieDetector_1.default); | ||
} | ||
@@ -48,3 +53,3 @@ detect(req) { | ||
LanguageDetector.type = 'languageDetector'; | ||
export default LanguageDetector; | ||
exports.default = LanguageDetector; | ||
//# sourceMappingURL=LanguageDetector.js.map |
@@ -1,2 +0,3 @@ | ||
export {}; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=types.js.map |
{ | ||
"name": "@os-team/i18next-express-middleware", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"license": "MIT", | ||
@@ -29,3 +29,3 @@ "repository": "git@gitlab.com:os-team/libs/utils.git", | ||
}, | ||
"gitHead": "eccc74a10845d550545a457542d2c14b1cce0e11" | ||
"gitHead": "c157087e0b513d46a7235f5b892cad6685ee15fc" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
19341
195
0