Skip to content

Commit 727d714

Browse files
committed
fix: incorrect locales type narrowing
1 parent 411dbf1 commit 727d714

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function generateI18nTypes(
176176
const legacyTypes = options.types === 'legacy'
177177
const i18nType = legacyTypes ? 'VueI18n' : 'Composer'
178178
const generatedLocales = simplifyLocaleOptions(nuxt, options)
179-
const resolvedLocaleType = isString(generatedLocales) ? 'Locale[]' : 'LocaleObject[]'
179+
const resolvedLocaleType = isString(generatedLocales.at(0)) ? 'Locale[]' : 'LocaleObject[]'
180180
const narrowedLocaleType = normalizedLocales.map(x => JSON.stringify(x.code)).join(' | ') || 'string'
181181

182182
const globalTranslationTypes = `

0 commit comments

Comments
 (0)