Skip to content

Commit 0fa610f

Browse files
authored
perf(fmt): avoid duplicate binary path checks (#204)
1 parent ba09df7 commit 0fa610f

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

packages/rstack/src/fmt/discoverPaths.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ const classifyPatterns = async (
296296

297297
const stats = await lstatSafe(filePath);
298298
if (stats?.isFile()) {
299-
return { kind: 'file', value: filePath };
299+
return isBinaryPath(filePath) ? undefined : { kind: 'file', value: filePath };
300300
}
301301
if (stats?.isDirectory()) {
302302
return { kind: 'directory', value: filePath };
@@ -436,10 +436,6 @@ const discoverFmtPaths = async ({
436436
const filePaths: string[] = [];
437437

438438
for (const filePath of candidates) {
439-
if (isBinaryPath(filePath)) {
440-
continue;
441-
}
442-
443439
if (negativeGlobMatchers.length) {
444440
const relativePath = toPosixPath(path.relative(cwd, filePath));
445441
if (negativeGlobMatchers.some((matches) => matches(relativePath))) {

0 commit comments

Comments
 (0)