Socket
Socket
Sign inDemoInstall

react-i18next

Package Overview
Dependencies
Maintainers
2
Versions
313
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-i18next - npm Package Compare versions

Comparing version 11.11.3 to 11.11.4

4

CHANGELOG.md

@@ -0,1 +1,5 @@

### 11.11.4
- typescript: add returnNull and returnEptyString options to TypeOptions interface [1341](https://github.com/i18next/react-i18next/pull/1341)
### 11.11.3

@@ -2,0 +6,0 @@

2

package.json
{
"name": "react-i18next",
"version": "11.11.3",
"version": "11.11.4",
"description": "Internationalization for react done right. Using the i18next i18n ecosystem.",

@@ -5,0 +5,0 @@ "main": "dist/commonjs/index.js",

@@ -29,3 +29,3 @@ import i18next, {

/**
* This interface can be augmented by users to add types to `react-i18next`. It accepts a `defaultNS` and `resources` properties.
* This interface can be augmented by users to add types to `react-i18next`. It accepts a `defaultNS`, `resources`, `returnNull` and `returnEmptyString` properties.
*

@@ -39,2 +39,4 @@ * Usage:

* defaultNS: 'custom';
* returnNull: false,
* returnEmptyString: false,
* resources: {

@@ -55,2 +57,4 @@ * custom: {

{
returnNull: true;
returnEmptyString: true;
defaultNS: 'translation';

@@ -117,2 +121,22 @@ resources: Resources;

type CustomTypeParameters = {
returnNull?: boolean;
returnEmptyString?: boolean;
};
type TypeOptionsFallback<TranslationValue, Option, MatchingValue> = Option extends false
? TranslationValue extends MatchingValue
? string
: TranslationValue
: TranslationValue;
/**
* Checks if user has enabled `returnEmptyString` and `returnNull` options to retrieve correct values.
*/
export type NormalizeByTypeOptions<
TranslationValue,
Options extends CustomTypeParameters = TypeOptions,
R = TypeOptionsFallback<TranslationValue, Options['returnEmptyString'], ''>
> = TypeOptionsFallback<R, Options['returnNull'], null>;
type NormalizeReturn<T, V> = V extends `${infer K}.${infer R}`

@@ -123,3 +147,3 @@ ? K extends keyof T

: V extends keyof T
? T[V]
? NormalizeByTypeOptions<T[V]>
: never;

@@ -126,0 +150,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc