i18next-cli 1.63.0 → 1.64.0

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/README.md CHANGED
@@ -152,7 +152,7 @@ remain the single source of truth — inlang tools read and write them in
152
152
  place, so there is no second catalog to drift. An existing
153
153
  `project.inlang/settings.json` is never overwritten; re-running `init` is
154
154
  safe. Requires JSON resource files. The plugin is pinned to an exact verified
155
- version (`@inlang/plugin-i18next@6.2.0`) — bump the `modules` URL in
155
+ version (`@inlang/plugin-i18next@6.2.1`) — bump the `modules` URL in
156
156
  `settings.json` to pick up newer plugin releases. Only `settings.json` is
157
157
  scaffolded by design: `project.inlang/` is the
158
158
  [unpacked (git-friendly)](https://inlang.com/docs/unpacked-project) project
@@ -773,8 +773,11 @@ export default defineConfig({
773
773
  mergeNamespaces: false,
774
774
 
775
775
  // Translation functions to detect. Defaults to ['t', '*.t'].
776
- // Supports wildcards for suffixes.
777
- functions: ['t', '*.t', 'i18next.t'],
776
+ // Supports a leading wildcard to match any object (suffix match), e.g.
777
+ // '*.t' matches `i18n.t` / `this._i18n.t`, and a trailing wildcard to match
778
+ // any method on an object (prefix match), e.g. 'tProps.*' matches
779
+ // `tProps.label` / `tProps.title`.
780
+ functions: ['t', '*.t', 'i18next.t', 'tProps.*'],
778
781
 
779
782
  // React components to analyze
780
783
  transComponents: ['Trans', 'Translation'],
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.63.0'); // This string is replaced with the actual version at build time by rollup
40
+ .version('1.64.0'); // 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
@@ -3,6 +3,7 @@
3
3
  var pluralRules = require('../../utils/plural-rules.js');
4
4
  var nesting = require('../../utils/nesting.js');
5
5
  var astUtils = require('./ast-utils.js');
6
+ var functionMatcher = require('../utils/function-matcher.js');
6
7
 
7
8
  // Helper to escape regex characters
8
9
  const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
@@ -72,19 +73,11 @@ class CallExpressionHandler {
72
73
  let isFunctionToParse = scopeInfo !== undefined; // A scoped variable (from useTranslation, etc.) is always parsed.
73
74
  if (!isFunctionToParse) {
74
75
  for (const pattern of configuredFunctions) {
75
- if (pattern.startsWith('*.')) {
76
- // Handle wildcard suffix (e.g., '*.t' matches 'i18n.t')
77
- if (functionName.endsWith(pattern.substring(1))) {
78
- isFunctionToParse = true;
79
- break;
80
- }
81
- }
82
- else {
83
- // Handle exact match
84
- if (pattern === functionName) {
85
- isFunctionToParse = true;
86
- break;
87
- }
76
+ // Supports exact ('t', 'i18next.t'), prefix wildcards ('*.t' -> 'i18n.t')
77
+ // and suffix wildcards ('tProps.*' -> 'tProps.label').
78
+ if (functionMatcher.matchesFunctionPattern(functionName, pattern)) {
79
+ isFunctionToParse = true;
80
+ break;
88
81
  }
89
82
  }
90
83
  }
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Checks whether a (possibly dotted) function name matches a configured
5
+ * `functions` pattern.
6
+ *
7
+ * Supported pattern forms:
8
+ * - Exact match: `'t'` matches `t`, `'i18next.t'` matches `i18next.t`.
9
+ * - Prefix wildcard: `'*.t'` matches any call ending in `.t`
10
+ * (e.g. `i18n.t`, `this._i18n.t`).
11
+ * - Suffix wildcard: `'tProps.*'` matches any single-segment member call on the
12
+ * prefix (e.g. `tProps.label`, `tProps.title`) but not deeper nesting like
13
+ * `tProps.label.t`.
14
+ *
15
+ * @param functionName - The dotted callee name (e.g. `tProps.label`).
16
+ * @param pattern - A single configured pattern from `extract.functions`.
17
+ */
18
+ function matchesFunctionPattern(functionName, pattern) {
19
+ if (pattern === functionName)
20
+ return true;
21
+ // Prefix wildcard, e.g. '*.t' -> matches any callee ending in '.t'
22
+ if (pattern.startsWith('*.')) {
23
+ return functionName.endsWith(pattern.slice(1));
24
+ }
25
+ // Suffix wildcard, e.g. 'tProps.*' -> matches 'tProps.<segment>'
26
+ if (pattern.endsWith('.*')) {
27
+ const prefix = pattern.slice(0, -1); // keep the trailing dot: 'tProps.'
28
+ if (!functionName.startsWith(prefix))
29
+ return false;
30
+ const rest = functionName.slice(prefix.length);
31
+ return rest.length > 0 && !rest.includes('.');
32
+ }
33
+ return false;
34
+ }
35
+
36
+ exports.matchesFunctionPattern = matchesFunctionPattern;
@@ -10,6 +10,7 @@ var logger = require('./utils/logger.js');
10
10
  var wrapOra = require('./utils/wrap-ora.js');
11
11
  var jsxAttributes = require('./utils/jsx-attributes.js');
12
12
  var astUtils = require('./extractor/parsers/ast-utils.js');
13
+ var functionMatcher = require('./extractor/utils/function-matcher.js');
13
14
 
14
15
  /**
15
16
  * Loads all translation values from the primary locale's JSON files and returns
@@ -141,28 +142,58 @@ function lintInterpolationParams(ast, code, config, translationValues) {
141
142
  }
142
143
  // Modularized CallExpression handler
143
144
  function handleCallExpression(node, ancestors) {
145
+ // Build the full dotted callee name (e.g. 'i18n.t', 'tProps.label') as well as
146
+ // the bare last segment ('t', 'label') so both exact and wildcard patterns match.
144
147
  let calleeName = '';
148
+ let fullCalleeName = '';
145
149
  if (node.callee) {
146
- if (node.callee.type === 'Identifier' && node.callee.value) {
147
- calleeName = node.callee.value;
150
+ if (node.callee.type === 'Identifier') {
151
+ calleeName = node.callee.value || node.callee.name || '';
152
+ fullCalleeName = calleeName;
148
153
  }
149
- else if (node.callee.type === 'Identifier' && node.callee.name) {
150
- calleeName = node.callee.name;
151
- }
152
- else if (node.callee.type === 'MemberExpression' && node.callee.property?.type === 'Identifier') {
153
- calleeName = node.callee.property.value || node.callee.property.name;
154
+ else if (node.callee.type === 'MemberExpression') {
155
+ const parts = [];
156
+ let current = node.callee;
157
+ let computed = false;
158
+ while (current?.type === 'MemberExpression') {
159
+ if (current.property?.type === 'Identifier') {
160
+ parts.unshift(current.property.value || current.property.name);
161
+ }
162
+ else {
163
+ computed = true;
164
+ break;
165
+ }
166
+ current = current.object;
167
+ }
168
+ if (!computed) {
169
+ if (current?.type === 'ThisExpression') {
170
+ parts.unshift('this');
171
+ }
172
+ else if (current?.type === 'Identifier') {
173
+ parts.unshift(current.value || current.name);
174
+ }
175
+ else {
176
+ parts.length = 0;
177
+ }
178
+ }
179
+ if (node.callee.property?.type === 'Identifier') {
180
+ calleeName = node.callee.property.value || node.callee.property.name;
181
+ }
182
+ fullCalleeName = parts.length ? parts.join('.') : calleeName;
154
183
  }
155
184
  }
156
185
  const fnPatterns = config.extract.functions || ['t', '*.t'];
157
186
  let matches = false;
158
187
  for (const pattern of fnPatterns) {
159
- if (pattern.startsWith('*.')) {
160
- if (calleeName === pattern.slice(2))
161
- matches = true;
188
+ if (functionMatcher.matchesFunctionPattern(fullCalleeName, pattern)) {
189
+ matches = true;
190
+ break;
162
191
  }
163
- else {
164
- if (calleeName === pattern)
165
- matches = true;
192
+ // Backwards-compatible: '*.X' also matches a call whose last segment is X
193
+ // (covers computed member expressions where the full chain is unavailable).
194
+ if (pattern.startsWith('*.') && calleeName === pattern.slice(2)) {
195
+ matches = true;
196
+ break;
166
197
  }
167
198
  }
168
199
  if (matches) {
@@ -297,6 +297,10 @@ function replaceKeyWithRegex(code, oldParts, newParts, config, namespaceKeyMap)
297
297
  const suffix = fnPattern.slice(2);
298
298
  return `\\b[\\w$]+\\.${escapeRegex(suffix)}`;
299
299
  }
300
+ if (fnPattern.endsWith('.*')) {
301
+ const prefix = fnPattern.slice(0, -2);
302
+ return `\\b${escapeRegex(prefix)}\\.[\\w$]+`;
303
+ }
300
304
  return `\\b${escapeRegex(fnPattern)}`;
301
305
  };
302
306
  // Helper: check whether the old key exists in a given namespace (from the prebuilt map)
@@ -8,12 +8,13 @@ var jsoncParser = require('jsonc-parser');
8
8
  * The plugin that teaches inlang tools (Sherlock, Fink, Paraglide) to read and
9
9
  * write i18next JSON resource files directly.
10
10
  *
11
- * Pinned to an exact version on purpose: 6.2.0 is the first release with
12
- * verified round-trip support for plurals, context, `_zero` and ordinal keys,
13
- * and jsDelivr serves floating range URLs (`@6`) from edge caches that can
14
- * lag releases by days. Bump deliberately when newer verified versions ship.
11
+ * Pinned to an exact version on purpose: 6.2.1 is the first release with
12
+ * verified round-trip support for plurals, context, `_zero` and ordinal keys
13
+ * AND working Sherlock inline annotations, and jsDelivr serves floating range
14
+ * URLs (`@6`) from edge caches that can lag releases by days. Bump
15
+ * deliberately when newer verified versions ship.
15
16
  */
16
- const INLANG_PLUGIN_MODULE = 'https://cdn.jsdelivr.net/npm/@inlang/plugin-i18next@6.2.0/dist/index.js';
17
+ const INLANG_PLUGIN_MODULE = 'https://cdn.jsdelivr.net/npm/@inlang/plugin-i18next@6.2.1/dist/index.js';
17
18
  /** VS Code marketplace id of the inlang Sherlock extension. */
18
19
  const SHERLOCK_EXTENSION_ID = 'inlang.vs-code-extension';
19
20
  /**
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.63.0'); // This string is replaced with the actual version at build time by rollup
34
+ .version('1.64.0'); // 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
@@ -1,6 +1,7 @@
1
1
  import { safePluralRules } from '../../utils/plural-rules.js';
2
2
  import { parseNestedReferences } from '../../utils/nesting.js';
3
3
  import { lineColumnFromOffset, isSimpleTemplateLiteral, getObjectPropValue, getObjectPropValueExpression } from './ast-utils.js';
4
+ import { matchesFunctionPattern } from '../utils/function-matcher.js';
4
5
 
5
6
  // Helper to escape regex characters
6
7
  const escapeRegex = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
@@ -70,19 +71,11 @@ class CallExpressionHandler {
70
71
  let isFunctionToParse = scopeInfo !== undefined; // A scoped variable (from useTranslation, etc.) is always parsed.
71
72
  if (!isFunctionToParse) {
72
73
  for (const pattern of configuredFunctions) {
73
- if (pattern.startsWith('*.')) {
74
- // Handle wildcard suffix (e.g., '*.t' matches 'i18n.t')
75
- if (functionName.endsWith(pattern.substring(1))) {
76
- isFunctionToParse = true;
77
- break;
78
- }
79
- }
80
- else {
81
- // Handle exact match
82
- if (pattern === functionName) {
83
- isFunctionToParse = true;
84
- break;
85
- }
74
+ // Supports exact ('t', 'i18next.t'), prefix wildcards ('*.t' -> 'i18n.t')
75
+ // and suffix wildcards ('tProps.*' -> 'tProps.label').
76
+ if (matchesFunctionPattern(functionName, pattern)) {
77
+ isFunctionToParse = true;
78
+ break;
86
79
  }
87
80
  }
88
81
  }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Checks whether a (possibly dotted) function name matches a configured
3
+ * `functions` pattern.
4
+ *
5
+ * Supported pattern forms:
6
+ * - Exact match: `'t'` matches `t`, `'i18next.t'` matches `i18next.t`.
7
+ * - Prefix wildcard: `'*.t'` matches any call ending in `.t`
8
+ * (e.g. `i18n.t`, `this._i18n.t`).
9
+ * - Suffix wildcard: `'tProps.*'` matches any single-segment member call on the
10
+ * prefix (e.g. `tProps.label`, `tProps.title`) but not deeper nesting like
11
+ * `tProps.label.t`.
12
+ *
13
+ * @param functionName - The dotted callee name (e.g. `tProps.label`).
14
+ * @param pattern - A single configured pattern from `extract.functions`.
15
+ */
16
+ function matchesFunctionPattern(functionName, pattern) {
17
+ if (pattern === functionName)
18
+ return true;
19
+ // Prefix wildcard, e.g. '*.t' -> matches any callee ending in '.t'
20
+ if (pattern.startsWith('*.')) {
21
+ return functionName.endsWith(pattern.slice(1));
22
+ }
23
+ // Suffix wildcard, e.g. 'tProps.*' -> matches 'tProps.<segment>'
24
+ if (pattern.endsWith('.*')) {
25
+ const prefix = pattern.slice(0, -1); // keep the trailing dot: 'tProps.'
26
+ if (!functionName.startsWith(prefix))
27
+ return false;
28
+ const rest = functionName.slice(prefix.length);
29
+ return rest.length > 0 && !rest.includes('.');
30
+ }
31
+ return false;
32
+ }
33
+
34
+ export { matchesFunctionPattern };
@@ -8,6 +8,7 @@ import { ConsoleLogger } from './utils/logger.js';
8
8
  import { createSpinnerLike } from './utils/wrap-ora.js';
9
9
  import { acceptedTags, translatableAttributes, ignoredTags, ignoredAttributeLowerSet } from './utils/jsx-attributes.js';
10
10
  import { findFirstTokenIndex, normalizeASTSpans, buildByteToCharMap, convertSpansToCharIndices, collectIgnoredLineRanges } from './extractor/parsers/ast-utils.js';
11
+ import { matchesFunctionPattern } from './extractor/utils/function-matcher.js';
11
12
 
12
13
  /**
13
14
  * Loads all translation values from the primary locale's JSON files and returns
@@ -139,28 +140,58 @@ function lintInterpolationParams(ast, code, config, translationValues) {
139
140
  }
140
141
  // Modularized CallExpression handler
141
142
  function handleCallExpression(node, ancestors) {
143
+ // Build the full dotted callee name (e.g. 'i18n.t', 'tProps.label') as well as
144
+ // the bare last segment ('t', 'label') so both exact and wildcard patterns match.
142
145
  let calleeName = '';
146
+ let fullCalleeName = '';
143
147
  if (node.callee) {
144
- if (node.callee.type === 'Identifier' && node.callee.value) {
145
- calleeName = node.callee.value;
148
+ if (node.callee.type === 'Identifier') {
149
+ calleeName = node.callee.value || node.callee.name || '';
150
+ fullCalleeName = calleeName;
146
151
  }
147
- else if (node.callee.type === 'Identifier' && node.callee.name) {
148
- calleeName = node.callee.name;
149
- }
150
- else if (node.callee.type === 'MemberExpression' && node.callee.property?.type === 'Identifier') {
151
- calleeName = node.callee.property.value || node.callee.property.name;
152
+ else if (node.callee.type === 'MemberExpression') {
153
+ const parts = [];
154
+ let current = node.callee;
155
+ let computed = false;
156
+ while (current?.type === 'MemberExpression') {
157
+ if (current.property?.type === 'Identifier') {
158
+ parts.unshift(current.property.value || current.property.name);
159
+ }
160
+ else {
161
+ computed = true;
162
+ break;
163
+ }
164
+ current = current.object;
165
+ }
166
+ if (!computed) {
167
+ if (current?.type === 'ThisExpression') {
168
+ parts.unshift('this');
169
+ }
170
+ else if (current?.type === 'Identifier') {
171
+ parts.unshift(current.value || current.name);
172
+ }
173
+ else {
174
+ parts.length = 0;
175
+ }
176
+ }
177
+ if (node.callee.property?.type === 'Identifier') {
178
+ calleeName = node.callee.property.value || node.callee.property.name;
179
+ }
180
+ fullCalleeName = parts.length ? parts.join('.') : calleeName;
152
181
  }
153
182
  }
154
183
  const fnPatterns = config.extract.functions || ['t', '*.t'];
155
184
  let matches = false;
156
185
  for (const pattern of fnPatterns) {
157
- if (pattern.startsWith('*.')) {
158
- if (calleeName === pattern.slice(2))
159
- matches = true;
186
+ if (matchesFunctionPattern(fullCalleeName, pattern)) {
187
+ matches = true;
188
+ break;
160
189
  }
161
- else {
162
- if (calleeName === pattern)
163
- matches = true;
190
+ // Backwards-compatible: '*.X' also matches a call whose last segment is X
191
+ // (covers computed member expressions where the full chain is unavailable).
192
+ if (pattern.startsWith('*.') && calleeName === pattern.slice(2)) {
193
+ matches = true;
194
+ break;
164
195
  }
165
196
  }
166
197
  if (matches) {
@@ -295,6 +295,10 @@ function replaceKeyWithRegex(code, oldParts, newParts, config, namespaceKeyMap)
295
295
  const suffix = fnPattern.slice(2);
296
296
  return `\\b[\\w$]+\\.${escapeRegex(suffix)}`;
297
297
  }
298
+ if (fnPattern.endsWith('.*')) {
299
+ const prefix = fnPattern.slice(0, -2);
300
+ return `\\b${escapeRegex(prefix)}\\.[\\w$]+`;
301
+ }
298
302
  return `\\b${escapeRegex(fnPattern)}`;
299
303
  };
300
304
  // Helper: check whether the old key exists in a given namespace (from the prebuilt map)
@@ -6,12 +6,13 @@ import { parse, modify, applyEdits } from 'jsonc-parser';
6
6
  * The plugin that teaches inlang tools (Sherlock, Fink, Paraglide) to read and
7
7
  * write i18next JSON resource files directly.
8
8
  *
9
- * Pinned to an exact version on purpose: 6.2.0 is the first release with
10
- * verified round-trip support for plurals, context, `_zero` and ordinal keys,
11
- * and jsDelivr serves floating range URLs (`@6`) from edge caches that can
12
- * lag releases by days. Bump deliberately when newer verified versions ship.
9
+ * Pinned to an exact version on purpose: 6.2.1 is the first release with
10
+ * verified round-trip support for plurals, context, `_zero` and ordinal keys
11
+ * AND working Sherlock inline annotations, and jsDelivr serves floating range
12
+ * URLs (`@6`) from edge caches that can lag releases by days. Bump
13
+ * deliberately when newer verified versions ship.
13
14
  */
14
- const INLANG_PLUGIN_MODULE = 'https://cdn.jsdelivr.net/npm/@inlang/plugin-i18next@6.2.0/dist/index.js';
15
+ const INLANG_PLUGIN_MODULE = 'https://cdn.jsdelivr.net/npm/@inlang/plugin-i18next@6.2.1/dist/index.js';
15
16
  /** VS Code marketplace id of the inlang Sherlock extension. */
16
17
  const SHERLOCK_EXTENSION_ID = 'inlang.vs-code-extension';
17
18
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18next-cli",
3
- "version": "1.63.0",
3
+ "version": "1.64.0",
4
4
  "description": "A unified, high-performance i18next CLI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +1 @@
1
- {"version":3,"file":"call-expression-handler.d.ts","sourceRoot":"","sources":["../../../src/extractor/parsers/call-expression-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA6C,MAAM,WAAW,CAAA;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,EAAgB,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1G,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAa7D,qBAAa,qBAAqB;IAChC,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,kBAAkB,CAAoB;IACvC,UAAU,cAAoB;IACrC,OAAO,CAAC,cAAc,CAAc;IACpC,OAAO,CAAC,cAAc,CAAc;IACpC,OAAO,CAAC,iBAAiB,CAAsC;gBAG7D,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,EAC7C,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,MAAM,MAAM,EAC5B,cAAc,EAAE,MAAM,MAAM,EAC5B,iBAAiB,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAA2B;IAW3E;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAiB3B;;;;;;;;;;;;;;OAcG;IACH,oBAAoB,CAAE,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,GAAG,SAAS,GAAG,IAAI;IAgaxG;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAmBzB,OAAO,CAAC,wBAAwB;IAyEhC;;;;;;OAMG;IACH,OAAO,CAAC,4BAA4B;IAsDpC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,sBAAsB;IA2B9B;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,uBAAuB;IAgB/B;;;;;;;;OAQG;IACH,OAAO,CAAC,iCAAiC;IAwFzC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,gBAAgB;IAyMxB;;;;;;;;;OASG;IACH,OAAO,CAAC,eAAe;CA2BxB"}
1
+ {"version":3,"file":"call-expression-handler.d.ts","sourceRoot":"","sources":["../../../src/extractor/parsers/call-expression-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA6C,MAAM,WAAW,CAAA;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,EAAgB,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1G,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAc7D,qBAAa,qBAAqB;IAChC,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,kBAAkB,CAAoB;IACvC,UAAU,cAAoB;IACrC,OAAO,CAAC,cAAc,CAAc;IACpC,OAAO,CAAC,cAAc,CAAc;IACpC,OAAO,CAAC,iBAAiB,CAAsC;gBAG7D,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,EAC7C,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,MAAM,MAAM,EAC5B,cAAc,EAAE,MAAM,MAAM,EAC5B,iBAAiB,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAA2B;IAW3E;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAiB3B;;;;;;;;;;;;;;OAcG;IACH,oBAAoB,CAAE,IAAI,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,GAAG,SAAS,GAAG,IAAI;IAyZxG;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAmBzB,OAAO,CAAC,wBAAwB;IAyEhC;;;;;;OAMG;IACH,OAAO,CAAC,4BAA4B;IAsDpC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,sBAAsB;IA2B9B;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,uBAAuB;IAgB/B;;;;;;;;OAQG;IACH,OAAO,CAAC,iCAAiC;IAwFzC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,gBAAgB;IAyMxB;;;;;;;;;OASG;IACH,OAAO,CAAC,eAAe;CA2BxB"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Checks whether a (possibly dotted) function name matches a configured
3
+ * `functions` pattern.
4
+ *
5
+ * Supported pattern forms:
6
+ * - Exact match: `'t'` matches `t`, `'i18next.t'` matches `i18next.t`.
7
+ * - Prefix wildcard: `'*.t'` matches any call ending in `.t`
8
+ * (e.g. `i18n.t`, `this._i18n.t`).
9
+ * - Suffix wildcard: `'tProps.*'` matches any single-segment member call on the
10
+ * prefix (e.g. `tProps.label`, `tProps.title`) but not deeper nesting like
11
+ * `tProps.label.t`.
12
+ *
13
+ * @param functionName - The dotted callee name (e.g. `tProps.label`).
14
+ * @param pattern - A single configured pattern from `extract.functions`.
15
+ */
16
+ export declare function matchesFunctionPattern(functionName: string, pattern: string): boolean;
17
+ /**
18
+ * Checks whether a function name matches any of the configured patterns.
19
+ *
20
+ * @param functionName - The dotted callee name (e.g. `tProps.label`).
21
+ * @param patterns - The configured `extract.functions` patterns.
22
+ */
23
+ export declare function matchesAnyFunctionPattern(functionName: string, patterns: string[]): boolean;
24
+ //# sourceMappingURL=function-matcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-matcher.d.ts","sourceRoot":"","sources":["../../../src/extractor/utils/function-matcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAiBtF;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAK5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../src/linter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,SAAS,EAA6B,MAAM,YAAY,CAAA;AA+QpG,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE;QAAC;YACT,OAAO,EAAE,MAAM,CAAC;SACjB;KAAC,CAAC;IACH,IAAI,EAAE;QAAC;YACL,OAAO,EAAE,OAAO,CAAC;YACjB,OAAO,EAAE,MAAM,CAAC;YAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CA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AE,MAAM,GAAG,KAAK,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,qBAAqB,CAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgD1F"}
1
+ {"version":3,"file":"inlang-scaffold.d.ts","sourceRoot":"","sources":["../../src/utils/inlang-scaffold.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,qBAAqB;IACpC,mGAAmG;IACnG,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,4FAA4F;IAC5F,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,CAAA;IACnE,oGAAoG;IACpG,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,qBAAqB,CAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgD1F"}