Skip to content

Commit b30a914

Browse files
committed
fix: simplify regexes
1 parent 4c0ef4e commit b30a914

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/unplugin-vue-i18n/src/core/resource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export function resourcePlugin(
295295
// virtual @intlify/unplugin-vue-i18n/messages
296296
if (
297297
!query.vue &&
298-
/\.(json5?|ya?ml|[c|m]?js|[c|m]?ts)$/.test(id) &&
298+
/\.(json5?|ya?ml|[c|m]?[j|t]s)$/.test(id) &&
299299
filter(id)
300300
) {
301301
langInfo = parsePath(filename).ext as SFCLangFormat
@@ -376,7 +376,7 @@ function getGenerator(ext: string, fallback: GeneratorFn = generateJSON) {
376376
return generateYAML
377377
}
378378

379-
if (/\.([c|m]?js|[c|m]?ts)$/.test(ext)) {
379+
if (/\.[c|m]?[j|t]s$/.test(ext)) {
380380
return generateJavaScript
381381
}
382382

0 commit comments

Comments
 (0)