We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6440f8c commit 634b62eCopy full SHA for 634b62e
src/utils/Regex.ts
@@ -20,10 +20,12 @@ export function handleRegexMatch(
20
const matchString = match[0]
21
22
let keyIndex = 1
23
- let nextIntlFunctionName = undefined
24
- if (scopes.some(s => isNextIntlScopeRange(s))) {
+ let nextIntlFunctionName: string | undefined
+ const hasNextIntlScope = scopes.some(s => isNextIntlScopeRange(s))
25
+ // Switch to NextIntl capture layout when the regex actually provided both groups
26
+ if (hasNextIntlScope && typeof match[2] !== 'undefined') {
27
keyIndex = 2
- nextIntlFunctionName = match[1]
28
+ nextIntlFunctionName = match[1] as string
29
}
30
let key = match[keyIndex]
31
if (!key)
0 commit comments