Skip to content

Commit 346f989

Browse files
committed
perf: expected file names mapped
1 parent 75cb258 commit 346f989

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/domain/getLabelConfigs.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ const getFilePath = (configurationPath: string): string | undefined => {
2020
)
2121
return
2222
}
23-
const files = allFiles.filter((elem) =>
24-
jsonTypes.map((elem) => `auto-label.${elem}`).includes(elem)
25-
)
23+
const expectedFilenames = jsonTypes.map((type) => `auto-label.${type}`);
24+
const files = allFiles.filter((filename) => expectedFilenames.includes(filename));
2625
if (!files.length) return
2726
return `${repoPath}/${files[0]}`.replace('//', '/')
2827
}

0 commit comments

Comments
 (0)