react-i18next 11.15.6 β 11.15.7
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/CHANGELOG.md +4 -0
- package/README.md +4 -4
- package/package.json +1 -1
- package/ts4.1/index.d.ts +5 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -144,10 +144,10 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
|
|
|
144
144
|
<!-- markdownlint-disable -->
|
|
145
145
|
<table>
|
|
146
146
|
<tr>
|
|
147
|
-
<td align="center"><a href="http://twitter.com/jamuhl"><img src="https://avatars3.githubusercontent.com/u/977772?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jan MΓΌhlemann</b></sub></a><br /><a href="https://github.com/i18next/react-i18next/commits?author=jamuhl" title="Code">π»</a> <a href="#example-jamuhl" title="Examples">π‘</a> <a href="https://github.com/i18next/react-i18next/commits?author=jamuhl" title="Documentation">π</a> <a href="#question-jamuhl" title="Answering Questions">π¬</a></td>
|
|
148
|
-
<td align="center"><a href="http://twitter.com/#!/adrirai"><img src="https://avatars0.githubusercontent.com/u/1086194?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Adriano Raiano</b></sub></a><br /><a href="https://github.com/i18next/react-i18next/commits?author=adrai" title="Code">π»</a> <a href="#example-adrai" title="Examples">π‘</a> <a href="https://github.com/i18next/react-i18next/commits?author=adrai" title="Documentation">π</a> <a href="#question-adrai" title="Answering Questions">π¬</a></td>
|
|
149
|
-
<td align="center"><a href="https://
|
|
150
|
-
<td align="center"><a href="https://
|
|
147
|
+
<td align="center"><a href="http://twitter.com/jamuhl"><img src="https://avatars3.githubusercontent.com/u/977772?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jan MΓΌhlemann</b></sub></a><br /><a href="https://github.com/i18next/react-i18next/commits?author=jamuhl" title="Code">π»</a> <a href="#example-jamuhl" title="Examples">π‘</a> <a href="https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Ajamuhl+" title="Reviewed Pull Requests">π</a> <a href="https://github.com/i18next/react-i18next/commits?author=jamuhl" title="Documentation">π</a> <a href="#question-jamuhl" title="Answering Questions">π¬</a></td>
|
|
148
|
+
<td align="center"><a href="http://twitter.com/#!/adrirai"><img src="https://avatars0.githubusercontent.com/u/1086194?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Adriano Raiano</b></sub></a><br /><a href="https://github.com/i18next/react-i18next/commits?author=adrai" title="Code">π»</a> <a href="#example-adrai" title="Examples">π‘</a> <a href="https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Aadrai+" title="Reviewed Pull Requests">π</a> <a href="https://github.com/i18next/react-i18next/commits?author=adrai" title="Documentation">π</a> <a href="#question-adrai" title="Answering Questions">π¬</a></td>
|
|
149
|
+
<td align="center"><a href="https://github.com/pedrodurek"><img src="https://avatars1.githubusercontent.com/u/12190482?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Pedro Durek</b></sub></a><br /><a href="https://github.com/i18next/react-i18next/commits?author=pedrodurek" title="Code">π»</a> <a href="#example-pedrodurek" title="Examples">π‘</a> <a href="https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Apedrodurek+" title="Reviewed Pull Requests">π</a> <a href="#question-pedrodurek" title="Answering Questions">π¬</a></td>
|
|
150
|
+
<td align="center"><a href="https://tigerabrodi.dev/"><img src="https://avatars1.githubusercontent.com/u/49603590?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Tiger Abrodi</b></sub></a><br /><a href="https://github.com/i18next/react-i18next/commits?author=tigerabrodi" title="Code">π»</a> <a href="https://github.com/i18next/react-i18next/pulls?q=is%3Apr+reviewed-by%3Atigerabrodi" title="Reviewed Pull Requests">π</a></td>
|
|
151
151
|
</tr>
|
|
152
152
|
</table>
|
|
153
153
|
|
package/package.json
CHANGED
package/ts4.1/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export interface Resources {}
|
|
|
37
37
|
* defaultNS: 'custom';
|
|
38
38
|
* returnNull: false;
|
|
39
39
|
* returnEmptyString: false;
|
|
40
|
+
* nsSeparator: ':';
|
|
40
41
|
* keySeparator: '.';
|
|
41
42
|
* jsonFormat: 'v4';
|
|
42
43
|
* resources: {
|
|
@@ -57,6 +58,7 @@ type TypeOptions = MergeBy<
|
|
|
57
58
|
returnNull: true;
|
|
58
59
|
returnEmptyString: true;
|
|
59
60
|
keySeparator: '.';
|
|
61
|
+
nsSeparator: ':';
|
|
60
62
|
defaultNS: 'translation';
|
|
61
63
|
jsonFormat: 'v4';
|
|
62
64
|
resources: Resources;
|
|
@@ -121,15 +123,16 @@ type Normalize2<T, K = keyof T> = K extends keyof T
|
|
|
121
123
|
type Normalize<T> = WithOrWithoutPlural<keyof T> | Normalize2<T>;
|
|
122
124
|
|
|
123
125
|
// Normalize multiple namespaces
|
|
126
|
+
type KeyWithNSSeparator<N, K, S extends string = TypeOptions['nsSeparator']> = `${N &
|
|
127
|
+
string}${S}${K & string}`;
|
|
124
128
|
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void
|
|
125
129
|
? I
|
|
126
130
|
: never;
|
|
127
131
|
type LastOf<T> = UnionToIntersection<T extends any ? () => T : never> extends () => infer R
|
|
128
132
|
? R
|
|
129
133
|
: never;
|
|
130
|
-
type AppendNS<N, K> = `${N & string}:${K & string}`;
|
|
131
134
|
type NormalizeMulti<T, U extends keyof T, L = LastOf<U>> = L extends U
|
|
132
|
-
?
|
|
135
|
+
? KeyWithNSSeparator<L, Normalize<T[L]>> | NormalizeMulti<T, Exclude<U, L>>
|
|
133
136
|
: never;
|
|
134
137
|
|
|
135
138
|
interface CustomTypeParameters {
|