Comparing version 23.4.2 to 23.4.3
@@ -1,1 +0,1 @@ | ||
{"type":"module","version":"23.4.2"} | ||
{"type":"module","version":"23.4.3"} |
{ | ||
"name": "i18next", | ||
"version": "23.4.2", | ||
"version": "23.4.3", | ||
"description": "i18next internationalization framework", | ||
@@ -113,3 +113,3 @@ "main": "./dist/cjs/i18next.js", | ||
"scripts": { | ||
"pretest": "npm run test:typescript && npm run test:typescript:customtypes && npm run test:typescript:defaulttypes && npm run test:typescript:fallbacktypes && npm run test:typescript:noninterop", | ||
"pretest": "npm run test:typescript && npm run test:typescript:customtypes && npm run test:typescript:defaulttypes && npm run test:typescript:fallbacktypes && npm run test:typescript:noninterop && npm run test:typescript:customcontextseparator", | ||
"lint": "eslint src", | ||
@@ -123,2 +123,3 @@ "test": "npm run lint && npm run test:new && npm run test:compat", | ||
"test:typescript:fallbacktypes": "tslint --project test/typescript/fallback-types/tsconfig.json", | ||
"test:typescript:customcontextseparator": "tslint --project test/typescript/custom-context-separator/tsconfig.json", | ||
"test:typescript:noninterop": "tslint --project tsconfig.nonEsModuleInterop.json", | ||
@@ -125,0 +126,0 @@ "tdd": "karma start karma.conf.js", |
@@ -58,3 +58,3 @@ import type { $MergeBy, $PreservedValue, $Dictionary } from './helpers.d.ts'; | ||
/** | ||
* Char to split namespace from key | ||
* Char to split plural from key | ||
*/ | ||
@@ -64,2 +64,7 @@ pluralSeparator: '_'; | ||
/** | ||
* Char to split context from key | ||
*/ | ||
contextSeparator: '_'; | ||
/** | ||
* Default namespace used if not passed to translation function | ||
@@ -66,0 +71,0 @@ */ |
@@ -22,2 +22,3 @@ import type { $OmitArrayKeys, $PreservedValue, $Dictionary, $SpecialObject } from './helpers.d.ts'; | ||
type _PluralSeparator = TypeOptions['pluralSeparator']; | ||
type _ContextSeparator = TypeOptions['contextSeparator']; | ||
type _FallbackNamespace = TypeOptions['fallbackNS']; | ||
@@ -108,3 +109,3 @@ type _Resources = TypeOptions['resources']; | ||
type FilterKeysByContext<Keys, TOpt extends TOptions> = TOpt['context'] extends string | ||
? Keys extends `${infer Prefix}_${TOpt['context']}${infer Suffix}` | ||
? Keys extends `${infer Prefix}${_ContextSeparator}${TOpt['context']}${infer Suffix}` | ||
? `${Prefix}${Suffix}` | ||
@@ -161,3 +162,3 @@ : never | ||
type KeyWithContext<Key, TOpt extends TOptions> = TOpt['context'] extends string | ||
? `${Key & string}_${TOpt['context']}` | ||
? `${Key & string}${_ContextSeparator}${TOpt['context']}` | ||
: Key; | ||
@@ -164,0 +165,0 @@ |
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
585834
13183