react-i18next
Advanced tools
Comparing version 11.15.4 to 11.15.5
@@ -0,1 +1,5 @@ | ||
### 11.15.5 | ||
- types: fix never return type when using plurals [1453](https://github.com/i18next/react-i18next/pull/1453) | ||
### 11.15.4 | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "react-i18next", | ||
"version": "11.15.4", | ||
"version": "11.15.5", | ||
"description": "Internationalization for react done right. Using the i18next i18n ecosystem.", | ||
@@ -5,0 +5,0 @@ "main": "dist/commonjs/index.js", |
@@ -98,4 +98,6 @@ import i18next, { | ||
type PluralSuffix = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other'; | ||
type WithOrWithoutPlural<K> = TypeOptions['jsonFormat'] extends 'v4' | ||
? K extends `${infer B}_${'zero' | 'one' | 'two' | 'few' | 'many' | 'other'}` | ||
? K extends `${infer B}_${PluralSuffix}` | ||
? B | K | ||
@@ -154,2 +156,8 @@ : K | ||
type StringIfPlural<T> = TypeOptions['jsonFormat'] extends 'v4' | ||
? T extends `${string}_${PluralSuffix}` | ||
? string | ||
: never | ||
: never; | ||
type NormalizeReturn< | ||
@@ -167,3 +175,3 @@ T, | ||
: never | ||
: never; | ||
: StringIfPlural<keyof T>; | ||
@@ -170,0 +178,0 @@ type NormalizeMultiReturn<T, V> = V extends `${infer N}:${infer R}` |
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
342018
6076