Skip to content

Commit 13c05ea

Browse files
committed
chore: update
1 parent 2f073ec commit 13c05ea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/core/src/config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,21 @@ async function isFileExist(filePath: string) {
8181

8282
const findConfig = async (basePath: string): Promise<string | undefined> => {
8383
return new Promise<string | undefined>((resolve) => {
84-
const arr: boolean[] = [];
84+
const arr: boolean[] = new Array(DEFAULT_CONFIG_EXTENSIONS.length).fill(
85+
null,
86+
);
8587
DEFAULT_CONFIG_EXTENSIONS.forEach(async (ext, index) => {
8688
const configPath = basePath + ext;
8789
const isExist = await isFileExist(configPath);
8890
arr[index] = isExist;
89-
const allResolved = arr.slice(0, index).every((i) => {
90-
return i === false;
91-
});
91+
const allResolved = arr.slice(0, index).every((i) => i === false);
9292

9393
if (allResolved) {
9494
if (isExist) {
9595
resolve(configPath);
9696
return;
9797
}
98-
if (arr.slice(index + 1).every((i) => i === false)) {
98+
if (arr.every((i) => i === false)) {
9999
resolve(undefined);
100100
return;
101101
}

0 commit comments

Comments
 (0)