i18next 26.0.2 → 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.
- package/dist/esm/package.json +1 -1
- package/index.d.ts +1 -0
- package/package.json +1 -1
- package/typescript/t.d.ts +10 -3
package/dist/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"26.0.
|
|
1
|
+
{"type":"module","version":"26.0.4"}
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
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
|
|
200
|
-
?
|
|
201
|
-
:
|
|
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 (
|