Skip to content

Commit 7015666

Browse files
authored
chore: simplify glob patterns (#2711)
1 parent 36ad3fe commit 7015666

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/cli-config-android/src/config/findComponentDescriptors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export function findComponentDescriptors(packageRoot: string) {
1616
// no jsSrcsDir, continue with default glob pattern
1717
}
1818
const globPattern = jsSrcsDir
19-
? `${jsSrcsDir}/**/+(*.js|*.jsx|*.ts|*.tsx)`
20-
: '**/+(*.js|*.jsx|*.ts|*.tsx)';
19+
? `${jsSrcsDir}/**/*{.js,.jsx,.ts,.tsx}`
20+
: '**/*{.js,.jsx,.ts,.tsx}';
2121
const files = glob.sync(globPattern, {
2222
cwd: unixifyPaths(packageRoot),
2323
onlyFiles: true,

packages/cli-config-android/src/config/findPackageClassName.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ export function getMainActivityFiles(
1818
let patternArray = [];
1919

2020
if (includePackage) {
21-
patternArray.push('*Package.java', '*Package.kt');
21+
patternArray.push('Package.java', 'Package.kt');
2222
} else {
23-
patternArray.push('*.java', '*.kt');
23+
patternArray.push('.java', '.kt');
2424
}
2525

26-
return glob.sync(`**/+(${patternArray.join('|')})`, {
26+
return glob.sync(`**/*{${patternArray.join(',')}}`, {
2727
cwd: unixifyPaths(folder),
2828
onlyFiles: true,
2929
ignore: ['**/.cxx/**'],

0 commit comments

Comments
 (0)