i18next-cli 1.70.1 → 1.70.3
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/dist/cjs/cli.js +1 -1
- package/dist/cjs/extractor/core/ast-visitors.js +38 -8
- package/dist/cjs/extractor/parsers/scope-manager.js +18 -1
- package/dist/esm/cli.js +1 -1
- package/dist/esm/extractor/core/ast-visitors.js +38 -8
- package/dist/esm/extractor/parsers/scope-manager.js +18 -1
- package/package.json +1 -1
- package/types/extractor/core/ast-visitors.d.ts +2 -0
- package/types/extractor/core/ast-visitors.d.ts.map +1 -1
- package/types/extractor/parsers/scope-manager.d.ts +1 -0
- package/types/extractor/parsers/scope-manager.d.ts.map +1 -1
package/dist/cjs/cli.js
CHANGED
|
@@ -37,7 +37,7 @@ const program = new commander.Command();
|
|
|
37
37
|
program
|
|
38
38
|
.name('i18next-cli')
|
|
39
39
|
.description('A unified, high-performance i18next CLI.')
|
|
40
|
-
.version('1.70.
|
|
40
|
+
.version('1.70.3'); // This string is replaced with the actual version at build time by rollup
|
|
41
41
|
// new: global config override option
|
|
42
42
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
43
43
|
program
|
|
@@ -218,6 +218,13 @@ class ASTVisitors {
|
|
|
218
218
|
node.type === 'ObjectMethod') {
|
|
219
219
|
this.scopeManager.enterScope();
|
|
220
220
|
isNewScope = true;
|
|
221
|
+
// `<Ns extends 'a' | 'b'>(t: TFunction<Ns>)` → constraint lookup for type params
|
|
222
|
+
const typeParamConstraints = {};
|
|
223
|
+
for (const tp of (node.typeParameters?.parameters ?? node.typeParameters?.params ?? [])) {
|
|
224
|
+
const name = tp?.name?.value ?? tp?.name?.name;
|
|
225
|
+
if (name && tp.constraint)
|
|
226
|
+
typeParamConstraints[name] = tp.constraint;
|
|
227
|
+
}
|
|
221
228
|
const params = (node.params && Array.isArray(node.params)) ? node.params : (node.params || []);
|
|
222
229
|
for (const p of params) {
|
|
223
230
|
// handle common param shapes: Identifier, AssignmentPattern (default), RestElement ignored
|
|
@@ -241,7 +248,7 @@ class ASTVisitors {
|
|
|
241
248
|
if (!memberName || !localName)
|
|
242
249
|
continue;
|
|
243
250
|
// `({ t }: { t: TFunction<'ns'> })` → bind `t` to that namespace
|
|
244
|
-
this.bindTFunctionParam(localName, this.getMemberTypeNode(patType, memberName));
|
|
251
|
+
this.bindTFunctionParam(localName, this.getMemberTypeNode(patType, memberName), typeParamConstraints);
|
|
245
252
|
if (!members?.[memberName])
|
|
246
253
|
continue;
|
|
247
254
|
this.expressionResolver.setTemporaryVariable(localName, members[memberName]);
|
|
@@ -294,7 +301,11 @@ class ASTVisitors {
|
|
|
294
301
|
else {
|
|
295
302
|
typeAnn = undefined;
|
|
296
303
|
}
|
|
297
|
-
this.bindTFunctionParam(paramKey, typeAnn);
|
|
304
|
+
this.bindTFunctionParam(paramKey, typeAnn, typeParamConstraints);
|
|
305
|
+
// `props: { t: TFunction<'ns'> }` → bind `props.t` so `props.t('key')` resolves
|
|
306
|
+
for (const { name, typeNode } of this.getObjectTypeMembers(typeAnn)) {
|
|
307
|
+
this.bindTFunctionParam(`${paramKey}.${name}`, typeNode, typeParamConstraints);
|
|
308
|
+
}
|
|
298
309
|
// Capture parameter type annotations as temporary variables in the
|
|
299
310
|
// expression resolver so that dynamic bracket expressions like
|
|
300
311
|
// `t(($) => $.table.columns[field])` can resolve `field` to its
|
|
@@ -560,7 +571,7 @@ class ASTVisitors {
|
|
|
560
571
|
* If `typeAnn` is a `TFunction<Ns, KPrefix>` type reference, register
|
|
561
572
|
* `paramKey` in the current scope with that namespace / keyPrefix.
|
|
562
573
|
*/
|
|
563
|
-
bindTFunctionParam(paramKey, typeAnn) {
|
|
574
|
+
bindTFunctionParam(paramKey, typeAnn, typeParamConstraints = {}) {
|
|
564
575
|
// Small helpers to robustly extract the referenced type name and literal string
|
|
565
576
|
const extractTypeName = (ta) => {
|
|
566
577
|
if (!ta)
|
|
@@ -584,6 +595,15 @@ class ASTVisitors {
|
|
|
584
595
|
const extractStringLiteralValue = (node) => {
|
|
585
596
|
if (!node)
|
|
586
597
|
return undefined;
|
|
598
|
+
// Union (`'a' | 'b'`) or generic constrained to one (`<Ns extends 'a' | 'b'>`):
|
|
599
|
+
// use the first member, mirroring i18next's type-level behaviour (first ns wins).
|
|
600
|
+
// Named aliases (`TFunction<Namespace>`) are deliberately NOT resolved: an
|
|
601
|
+
// app-wide `Namespace` union would otherwise "win" with an arbitrary first entry.
|
|
602
|
+
if (node.type === 'TsUnionType')
|
|
603
|
+
return extractStringLiteralValue(node.types?.[0]);
|
|
604
|
+
if (node.type === 'TsTypeReference' && node.typeName?.type === 'Identifier') {
|
|
605
|
+
return extractStringLiteralValue(typeParamConstraints[node.typeName.value]);
|
|
606
|
+
}
|
|
587
607
|
// Handle: typeof SomeConst → TsTypeQuery { exprName: { value: 'SomeConst' } }
|
|
588
608
|
if (node?.type === 'TsTypeQuery') {
|
|
589
609
|
const name = node.exprName?.value ?? node.exprName?.name;
|
|
@@ -682,8 +702,17 @@ class ASTVisitors {
|
|
|
682
702
|
* alias name).
|
|
683
703
|
*/
|
|
684
704
|
getMemberTypeNode(tsType, memberName) {
|
|
705
|
+
return this.getObjectTypeMembers(tsType).find(m => m.name === memberName)?.typeNode;
|
|
706
|
+
}
|
|
707
|
+
/** `{ name, typeNode }` for every property of an object-shaped type annotation. */
|
|
708
|
+
getObjectTypeMembers(tsType) {
|
|
685
709
|
if (!tsType)
|
|
686
|
-
return
|
|
710
|
+
return [];
|
|
711
|
+
// `A & { t: TFunction<'ns'> }` / `(A)` → union of the constituents' members
|
|
712
|
+
if (tsType.type === 'TsIntersectionType')
|
|
713
|
+
return (tsType.types ?? []).flatMap((t) => this.getObjectTypeMembers(t));
|
|
714
|
+
if (tsType.type === 'TsParenthesizedType')
|
|
715
|
+
return this.getObjectTypeMembers(tsType.typeAnnotation);
|
|
687
716
|
let members;
|
|
688
717
|
if (tsType.type === 'TsTypeLiteral')
|
|
689
718
|
members = tsType.members;
|
|
@@ -691,15 +720,16 @@ class ASTVisitors {
|
|
|
691
720
|
members = this.expressionResolver.getObjectTypeMembersRaw(tsType.typeName.value);
|
|
692
721
|
}
|
|
693
722
|
if (!Array.isArray(members))
|
|
694
|
-
return
|
|
723
|
+
return [];
|
|
724
|
+
const out = [];
|
|
695
725
|
for (const m of members) {
|
|
696
726
|
if (m?.type !== 'TsPropertySignature')
|
|
697
727
|
continue;
|
|
698
728
|
const name = m.key?.type === 'Identifier' || m.key?.type === 'StringLiteral' ? m.key.value : undefined;
|
|
699
|
-
if (name
|
|
700
|
-
|
|
729
|
+
if (name)
|
|
730
|
+
out.push({ name, typeNode: m.typeAnnotation?.typeAnnotation ?? m.typeAnnotation });
|
|
701
731
|
}
|
|
702
|
-
return
|
|
732
|
+
return out;
|
|
703
733
|
}
|
|
704
734
|
/**
|
|
705
735
|
* If `node` is a call like `ARRAY.map(param => ...)` where ARRAY is a known
|
|
@@ -15,6 +15,8 @@ class ScopeManager {
|
|
|
15
15
|
simpleConstants = new Map();
|
|
16
16
|
// Track simple local constant objects with string literal property values
|
|
17
17
|
simpleConstantObjects = new Map();
|
|
18
|
+
// `const NS = ['a', 'b']` → used by resolveNsArg for `useTranslation(NS)`.
|
|
19
|
+
simpleConstantArrays = new Map();
|
|
18
20
|
// Shared (cross-file) tables so that exported constants from one file can be
|
|
19
21
|
// resolved when imported in another. These are NOT cleared by reset().
|
|
20
22
|
sharedConstants = new Map();
|
|
@@ -68,6 +70,7 @@ class ScopeManager {
|
|
|
68
70
|
this.scope = new Map();
|
|
69
71
|
this.simpleConstants.clear();
|
|
70
72
|
this.simpleConstantObjects.clear();
|
|
73
|
+
this.simpleConstantArrays.clear();
|
|
71
74
|
this.thisFieldStack = [];
|
|
72
75
|
}
|
|
73
76
|
/**
|
|
@@ -258,6 +261,15 @@ class ScopeManager {
|
|
|
258
261
|
this.sharedConstantObjects.set(node.id.value, map);
|
|
259
262
|
}
|
|
260
263
|
}
|
|
264
|
+
else if (unwrapped?.type === 'ArrayExpression') {
|
|
265
|
+
const arr = unwrapped.elements
|
|
266
|
+
.map((el) => ScopeManager.unwrapTsExpression(el?.expression))
|
|
267
|
+
.filter((e) => e?.type === 'StringLiteral')
|
|
268
|
+
.map((e) => e.value);
|
|
269
|
+
if (arr.length > 0 && arr.length === unwrapped.elements.length) {
|
|
270
|
+
this.simpleConstantArrays.set(node.id.value, arr);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
261
273
|
else {
|
|
262
274
|
const fromType = ScopeManager.extractStringFromTypeAnnotation(node);
|
|
263
275
|
if (fromType !== undefined) {
|
|
@@ -555,10 +567,15 @@ class ScopeManager {
|
|
|
555
567
|
resolveNsArg(nsNode) {
|
|
556
568
|
if (!nsNode)
|
|
557
569
|
return {};
|
|
570
|
+
nsNode = ScopeManager.unwrapTsExpression(nsNode); // `[...] as const`, `satisfies`, `as X`
|
|
558
571
|
if (nsNode.type === 'StringLiteral')
|
|
559
572
|
return { defaultNs: nsNode.value };
|
|
560
|
-
if (nsNode.type === 'Identifier')
|
|
573
|
+
if (nsNode.type === 'Identifier') {
|
|
574
|
+
const arr = this.simpleConstantArrays.get(nsNode.value);
|
|
575
|
+
if (arr)
|
|
576
|
+
return { defaultNs: arr[0], namespaces: arr };
|
|
561
577
|
return { defaultNs: this.resolveSimpleStringIdentifier(nsNode.value) };
|
|
578
|
+
}
|
|
562
579
|
if (nsNode.type === 'MemberExpression')
|
|
563
580
|
return { defaultNs: this.resolveSimpleMemberExpression(nsNode) };
|
|
564
581
|
// `useTranslation(ns ?? 'fallback')` / `useTranslation(ns || 'fallback')`:
|
package/dist/esm/cli.js
CHANGED
|
@@ -31,7 +31,7 @@ const program = new Command();
|
|
|
31
31
|
program
|
|
32
32
|
.name('i18next-cli')
|
|
33
33
|
.description('A unified, high-performance i18next CLI.')
|
|
34
|
-
.version('1.70.
|
|
34
|
+
.version('1.70.3'); // This string is replaced with the actual version at build time by rollup
|
|
35
35
|
// new: global config override option
|
|
36
36
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
37
37
|
program
|
|
@@ -216,6 +216,13 @@ class ASTVisitors {
|
|
|
216
216
|
node.type === 'ObjectMethod') {
|
|
217
217
|
this.scopeManager.enterScope();
|
|
218
218
|
isNewScope = true;
|
|
219
|
+
// `<Ns extends 'a' | 'b'>(t: TFunction<Ns>)` → constraint lookup for type params
|
|
220
|
+
const typeParamConstraints = {};
|
|
221
|
+
for (const tp of (node.typeParameters?.parameters ?? node.typeParameters?.params ?? [])) {
|
|
222
|
+
const name = tp?.name?.value ?? tp?.name?.name;
|
|
223
|
+
if (name && tp.constraint)
|
|
224
|
+
typeParamConstraints[name] = tp.constraint;
|
|
225
|
+
}
|
|
219
226
|
const params = (node.params && Array.isArray(node.params)) ? node.params : (node.params || []);
|
|
220
227
|
for (const p of params) {
|
|
221
228
|
// handle common param shapes: Identifier, AssignmentPattern (default), RestElement ignored
|
|
@@ -239,7 +246,7 @@ class ASTVisitors {
|
|
|
239
246
|
if (!memberName || !localName)
|
|
240
247
|
continue;
|
|
241
248
|
// `({ t }: { t: TFunction<'ns'> })` → bind `t` to that namespace
|
|
242
|
-
this.bindTFunctionParam(localName, this.getMemberTypeNode(patType, memberName));
|
|
249
|
+
this.bindTFunctionParam(localName, this.getMemberTypeNode(patType, memberName), typeParamConstraints);
|
|
243
250
|
if (!members?.[memberName])
|
|
244
251
|
continue;
|
|
245
252
|
this.expressionResolver.setTemporaryVariable(localName, members[memberName]);
|
|
@@ -292,7 +299,11 @@ class ASTVisitors {
|
|
|
292
299
|
else {
|
|
293
300
|
typeAnn = undefined;
|
|
294
301
|
}
|
|
295
|
-
this.bindTFunctionParam(paramKey, typeAnn);
|
|
302
|
+
this.bindTFunctionParam(paramKey, typeAnn, typeParamConstraints);
|
|
303
|
+
// `props: { t: TFunction<'ns'> }` → bind `props.t` so `props.t('key')` resolves
|
|
304
|
+
for (const { name, typeNode } of this.getObjectTypeMembers(typeAnn)) {
|
|
305
|
+
this.bindTFunctionParam(`${paramKey}.${name}`, typeNode, typeParamConstraints);
|
|
306
|
+
}
|
|
296
307
|
// Capture parameter type annotations as temporary variables in the
|
|
297
308
|
// expression resolver so that dynamic bracket expressions like
|
|
298
309
|
// `t(($) => $.table.columns[field])` can resolve `field` to its
|
|
@@ -558,7 +569,7 @@ class ASTVisitors {
|
|
|
558
569
|
* If `typeAnn` is a `TFunction<Ns, KPrefix>` type reference, register
|
|
559
570
|
* `paramKey` in the current scope with that namespace / keyPrefix.
|
|
560
571
|
*/
|
|
561
|
-
bindTFunctionParam(paramKey, typeAnn) {
|
|
572
|
+
bindTFunctionParam(paramKey, typeAnn, typeParamConstraints = {}) {
|
|
562
573
|
// Small helpers to robustly extract the referenced type name and literal string
|
|
563
574
|
const extractTypeName = (ta) => {
|
|
564
575
|
if (!ta)
|
|
@@ -582,6 +593,15 @@ class ASTVisitors {
|
|
|
582
593
|
const extractStringLiteralValue = (node) => {
|
|
583
594
|
if (!node)
|
|
584
595
|
return undefined;
|
|
596
|
+
// Union (`'a' | 'b'`) or generic constrained to one (`<Ns extends 'a' | 'b'>`):
|
|
597
|
+
// use the first member, mirroring i18next's type-level behaviour (first ns wins).
|
|
598
|
+
// Named aliases (`TFunction<Namespace>`) are deliberately NOT resolved: an
|
|
599
|
+
// app-wide `Namespace` union would otherwise "win" with an arbitrary first entry.
|
|
600
|
+
if (node.type === 'TsUnionType')
|
|
601
|
+
return extractStringLiteralValue(node.types?.[0]);
|
|
602
|
+
if (node.type === 'TsTypeReference' && node.typeName?.type === 'Identifier') {
|
|
603
|
+
return extractStringLiteralValue(typeParamConstraints[node.typeName.value]);
|
|
604
|
+
}
|
|
585
605
|
// Handle: typeof SomeConst → TsTypeQuery { exprName: { value: 'SomeConst' } }
|
|
586
606
|
if (node?.type === 'TsTypeQuery') {
|
|
587
607
|
const name = node.exprName?.value ?? node.exprName?.name;
|
|
@@ -680,8 +700,17 @@ class ASTVisitors {
|
|
|
680
700
|
* alias name).
|
|
681
701
|
*/
|
|
682
702
|
getMemberTypeNode(tsType, memberName) {
|
|
703
|
+
return this.getObjectTypeMembers(tsType).find(m => m.name === memberName)?.typeNode;
|
|
704
|
+
}
|
|
705
|
+
/** `{ name, typeNode }` for every property of an object-shaped type annotation. */
|
|
706
|
+
getObjectTypeMembers(tsType) {
|
|
683
707
|
if (!tsType)
|
|
684
|
-
return
|
|
708
|
+
return [];
|
|
709
|
+
// `A & { t: TFunction<'ns'> }` / `(A)` → union of the constituents' members
|
|
710
|
+
if (tsType.type === 'TsIntersectionType')
|
|
711
|
+
return (tsType.types ?? []).flatMap((t) => this.getObjectTypeMembers(t));
|
|
712
|
+
if (tsType.type === 'TsParenthesizedType')
|
|
713
|
+
return this.getObjectTypeMembers(tsType.typeAnnotation);
|
|
685
714
|
let members;
|
|
686
715
|
if (tsType.type === 'TsTypeLiteral')
|
|
687
716
|
members = tsType.members;
|
|
@@ -689,15 +718,16 @@ class ASTVisitors {
|
|
|
689
718
|
members = this.expressionResolver.getObjectTypeMembersRaw(tsType.typeName.value);
|
|
690
719
|
}
|
|
691
720
|
if (!Array.isArray(members))
|
|
692
|
-
return
|
|
721
|
+
return [];
|
|
722
|
+
const out = [];
|
|
693
723
|
for (const m of members) {
|
|
694
724
|
if (m?.type !== 'TsPropertySignature')
|
|
695
725
|
continue;
|
|
696
726
|
const name = m.key?.type === 'Identifier' || m.key?.type === 'StringLiteral' ? m.key.value : undefined;
|
|
697
|
-
if (name
|
|
698
|
-
|
|
727
|
+
if (name)
|
|
728
|
+
out.push({ name, typeNode: m.typeAnnotation?.typeAnnotation ?? m.typeAnnotation });
|
|
699
729
|
}
|
|
700
|
-
return
|
|
730
|
+
return out;
|
|
701
731
|
}
|
|
702
732
|
/**
|
|
703
733
|
* If `node` is a call like `ARRAY.map(param => ...)` where ARRAY is a known
|
|
@@ -13,6 +13,8 @@ class ScopeManager {
|
|
|
13
13
|
simpleConstants = new Map();
|
|
14
14
|
// Track simple local constant objects with string literal property values
|
|
15
15
|
simpleConstantObjects = new Map();
|
|
16
|
+
// `const NS = ['a', 'b']` → used by resolveNsArg for `useTranslation(NS)`.
|
|
17
|
+
simpleConstantArrays = new Map();
|
|
16
18
|
// Shared (cross-file) tables so that exported constants from one file can be
|
|
17
19
|
// resolved when imported in another. These are NOT cleared by reset().
|
|
18
20
|
sharedConstants = new Map();
|
|
@@ -66,6 +68,7 @@ class ScopeManager {
|
|
|
66
68
|
this.scope = new Map();
|
|
67
69
|
this.simpleConstants.clear();
|
|
68
70
|
this.simpleConstantObjects.clear();
|
|
71
|
+
this.simpleConstantArrays.clear();
|
|
69
72
|
this.thisFieldStack = [];
|
|
70
73
|
}
|
|
71
74
|
/**
|
|
@@ -256,6 +259,15 @@ class ScopeManager {
|
|
|
256
259
|
this.sharedConstantObjects.set(node.id.value, map);
|
|
257
260
|
}
|
|
258
261
|
}
|
|
262
|
+
else if (unwrapped?.type === 'ArrayExpression') {
|
|
263
|
+
const arr = unwrapped.elements
|
|
264
|
+
.map((el) => ScopeManager.unwrapTsExpression(el?.expression))
|
|
265
|
+
.filter((e) => e?.type === 'StringLiteral')
|
|
266
|
+
.map((e) => e.value);
|
|
267
|
+
if (arr.length > 0 && arr.length === unwrapped.elements.length) {
|
|
268
|
+
this.simpleConstantArrays.set(node.id.value, arr);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
259
271
|
else {
|
|
260
272
|
const fromType = ScopeManager.extractStringFromTypeAnnotation(node);
|
|
261
273
|
if (fromType !== undefined) {
|
|
@@ -553,10 +565,15 @@ class ScopeManager {
|
|
|
553
565
|
resolveNsArg(nsNode) {
|
|
554
566
|
if (!nsNode)
|
|
555
567
|
return {};
|
|
568
|
+
nsNode = ScopeManager.unwrapTsExpression(nsNode); // `[...] as const`, `satisfies`, `as X`
|
|
556
569
|
if (nsNode.type === 'StringLiteral')
|
|
557
570
|
return { defaultNs: nsNode.value };
|
|
558
|
-
if (nsNode.type === 'Identifier')
|
|
571
|
+
if (nsNode.type === 'Identifier') {
|
|
572
|
+
const arr = this.simpleConstantArrays.get(nsNode.value);
|
|
573
|
+
if (arr)
|
|
574
|
+
return { defaultNs: arr[0], namespaces: arr };
|
|
559
575
|
return { defaultNs: this.resolveSimpleStringIdentifier(nsNode.value) };
|
|
576
|
+
}
|
|
560
577
|
if (nsNode.type === 'MemberExpression')
|
|
561
578
|
return { defaultNs: this.resolveSimpleMemberExpression(nsNode) };
|
|
562
579
|
// `useTranslation(ns ?? 'fallback')` / `useTranslation(ns || 'fallback')`:
|
package/package.json
CHANGED
|
@@ -96,6 +96,8 @@ export declare class ASTVisitors {
|
|
|
96
96
|
* alias name).
|
|
97
97
|
*/
|
|
98
98
|
private getMemberTypeNode;
|
|
99
|
+
/** `{ name, typeNode }` for every property of an object-shaped type annotation. */
|
|
100
|
+
private getObjectTypeMembers;
|
|
99
101
|
/**
|
|
100
102
|
* If `node` is a call like `ARRAY.map(param => ...)` where ARRAY is a known
|
|
101
103
|
* string-array constant, returns the callback's first parameter name and the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast-visitors.d.ts","sourceRoot":"","sources":["../../../src/extractor/core/ast-visitors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAQ,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAItE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;IAC9D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,KAAK,CAAiB;IAE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K,MAAM;CAGjC"}
|
|
@@ -7,6 +7,7 @@ export declare class ScopeManager {
|
|
|
7
7
|
private thisFieldStack;
|
|
8
8
|
private simpleConstants;
|
|
9
9
|
private simpleConstantObjects;
|
|
10
|
+
private simpleConstantArrays;
|
|
10
11
|
private sharedConstants;
|
|
11
12
|
private sharedConstantObjects;
|
|
12
13
|
constructor(config: Omit<I18nextToolkitConfig, 'plugins'>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-manager.d.ts","sourceRoot":"","sources":["../../../src/extractor/parsers/scope-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAEV,kBAAkB,EAMnB,MAAM,WAAW,CAAA;AAClB,OAAO,KAAK,EAAE,SAAS,EAA4B,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAG/F,qBAAa,YAAY;IACvB,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,KAAK,CAAqE;IAMlF,OAAO,CAAC,cAAc,CAAoC;IAG1D,OAAO,CAAC,eAAe,CAAiC;IAGxD,OAAO,CAAC,qBAAqB,CAAiD;
|
|
1
|
+
{"version":3,"file":"scope-manager.d.ts","sourceRoot":"","sources":["../../../src/extractor/parsers/scope-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAEV,kBAAkB,EAMnB,MAAM,WAAW,CAAA;AAClB,OAAO,KAAK,EAAE,SAAS,EAA4B,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAG/F,qBAAa,YAAY;IACvB,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,KAAK,CAAqE;IAMlF,OAAO,CAAC,cAAc,CAAoC;IAG1D,OAAO,CAAC,eAAe,CAAiC;IAGxD,OAAO,CAAC,qBAAqB,CAAiD;IAE9E,OAAO,CAAC,oBAAoB,CAAmC;IAI/D,OAAO,CAAC,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