i18next 26.0.3 → 26.0.4

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.
@@ -1 +1 @@
1
- {"type":"module","version":"26.0.3"}
1
+ {"type":"module","version":"26.0.4"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18next",
3
- "version": "26.0.3",
3
+ "version": "26.0.4",
4
4
  "description": "i18next internationalization framework",
5
5
  "main": "./dist/cjs/i18next.js",
6
6
  "module": "./dist/esm/i18next.js",
package/typescript/t.d.ts CHANGED
@@ -189,6 +189,9 @@ type _BuiltInFormatTypeMap = {
189
189
  list: readonly string[];
190
190
  };
191
191
 
192
+ /** Strips inline formatting options, e.g. `currency(EUR)` → `currency`. */
193
+ type _StripFormatOptions<F> = F extends `${infer Name}(${string})` ? Name : F;
194
+
192
195
  /** Resolves the type for a single interpolation entry based on name and format. */
193
196
  type _ResolveEntryType<Name extends string, Format> = [Format] extends [never]
194
197
  ? Name extends 'count'
@@ -196,9 +199,13 @@ type _ResolveEntryType<Name extends string, Format> = [Format] extends [never]
196
199
  : string
197
200
  : Format extends keyof _InterpolationFormatTypeMap
198
201
  ? _InterpolationFormatTypeMap[Format]
199
- : Format extends keyof _BuiltInFormatTypeMap
200
- ? _BuiltInFormatTypeMap[Format]
201
- : string;
202
+ : _StripFormatOptions<Format> extends keyof _InterpolationFormatTypeMap
203
+ ? _InterpolationFormatTypeMap[_StripFormatOptions<Format> & keyof _InterpolationFormatTypeMap]
204
+ : Format extends keyof _BuiltInFormatTypeMap
205
+ ? _BuiltInFormatTypeMap[Format]
206
+ : _StripFormatOptions<Format> extends keyof _BuiltInFormatTypeMap
207
+ ? _BuiltInFormatTypeMap[_StripFormatOptions<Format> & keyof _BuiltInFormatTypeMap]
208
+ : string;
202
209
 
203
210
  /** Local union-to-intersection (not exported from helpers). */
204
211
  type _UnionToIntersection<T> = (T extends unknown ? (k: T) => void : never) extends (