Modernization release — full rewrite in TypeScript.
- Requires Node.js >= 18 and i18next >= 19.6 (drops the removed
isWhitelistedAPI in favour ofisSupportedCode). - Dual ESM/CJS package built with tsdown (rolldown). With
require, useconst { LanguageDetector } = require('koa-i18next-detector'). - Wildcard (
*) entries inAccept-Languageare ignored instead of being passed to i18next. addDetectorthrows aTypeErrorfor detectors without aname/lookup(previously logged to console).
- TypeScript types for all options, contexts, and custom detectors.
- Cookie attributes:
cookiePath,cookieSecure,cookieSameSite,cookieHttpOnly. convertDetectedLanguageoption ('Iso15897'or a custom function), matching i18next-http-middleware.- Detected values are screened against common XSS payloads.
- Test suite (vitest), including integration tests against i18next v26.
- The
cookiesruntime dependency — the package now has zero runtime dependencies.
See git history.