Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

i18next

Package Overview
Dependencies
Maintainers
2
Versions
517
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18next - npm Package Compare versions

Comparing version 24.1.2 to 24.2.0

2

dist/esm/package.json

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

{"type":"module","version":"24.1.2"}
{"type":"module","version":"24.2.0"}
{
"name": "i18next",
"version": "24.1.2",
"version": "24.2.0",
"description": "i18next internationalization framework",

@@ -5,0 +5,0 @@ "main": "./dist/cjs/i18next.js",

@@ -78,2 +78,8 @@ import type { $MergeBy, $PreservedValue, $Dictionary } from './helpers.js';

/**
* Flag that enables strict key checking even if a `defaultValue` has been provided.
* This ensures all calls of `t` function don't accidentally use implicitly missing keys.
*/
strictKeyChecks: false;
/**
* Prefix for interpolation

@@ -80,0 +86,0 @@ */

@@ -35,2 +35,3 @@ import type {

type _UnescapeSuffix = TypeOptions['unescapeSuffix'];
type _StrictKeyChecks = TypeOptions['strictKeyChecks'];

@@ -282,3 +283,4 @@ type $IsResourcesDefined = [keyof _Resources] extends [never] ? false : true;

************************* */
export interface TFunction<Ns extends Namespace = DefaultNamespace, KPrefix = undefined> {
interface TFunctionStrict<Ns extends Namespace = DefaultNamespace, KPrefix = undefined> {
$TFunctionBrand: $IsResourcesDefined extends true ? `${$FirstNamespace<Ns>}` : never;

@@ -289,2 +291,23 @@ <

Ret extends TFunctionReturn<Ns, AppendKeyPrefix<Key, KPrefix>, TOpt>,
>(
key: Key | Key[],
options?: TOpt & InterpolationMap<Ret>,
): TFunctionReturnOptionalDetails<TFunctionProcessReturnValue<$NoInfer<Ret>, never>, TOpt>;
<
const Key extends ParseKeys<Ns, TOpt, KPrefix> | TemplateStringsArray,
const TOpt extends TOptions,
Ret extends TFunctionReturn<Ns, AppendKeyPrefix<Key, KPrefix>, TOpt>,
>(
key: Key | Key[],
defaultValue: string,
options?: TOpt & InterpolationMap<Ret>,
): TFunctionReturnOptionalDetails<TFunctionProcessReturnValue<$NoInfer<Ret>, never>, TOpt>;
}
interface TFunctionNonStrict<Ns extends Namespace = DefaultNamespace, KPrefix = undefined> {
$TFunctionBrand: $IsResourcesDefined extends true ? `${$FirstNamespace<Ns>}` : never;
<
const Key extends ParseKeys<Ns, TOpt, KPrefix> | TemplateStringsArray,
const TOpt extends TOptions,
Ret extends TFunctionReturn<Ns, AppendKeyPrefix<Key, KPrefix>, TOpt>,
const ActualOptions extends TOpt & InterpolationMap<Ret> = TOpt & InterpolationMap<Ret>,

@@ -300,2 +323,7 @@ DefaultValue extends string = never,

export type TFunction<
Ns extends Namespace = DefaultNamespace,
KPrefix = undefined,
> = _StrictKeyChecks extends true ? TFunctionStrict<Ns, KPrefix> : TFunctionNonStrict<Ns, KPrefix>;
export type KeyPrefix<Ns extends Namespace> = ResourceKeys<true>[$FirstNamespace<Ns>] | undefined;
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