Skip to content

Commit ea4ee3e

Browse files
committed
fix: fix picomatch usage
1 parent 598cc9a commit ea4ee3e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/lib/fileList.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,14 @@ async function createChildTree(parent, item, root) {
310310

311311
parent.children.push(file);
312312
if (isDirectory) {
313-
const ignore = !!settings.value.excludeFolders.find((folder) =>
314-
picomatch(Url.join(file.path, ""), folder, { matchBase: true }),
315-
);
316-
if (ignore) return;
313+
if (
314+
picomatch.isMatch(
315+
settings.value.excludeFolders,
316+
Url.join(file.path, ""),
317+
{ matchBase: true },
318+
)
319+
)
320+
return;
317321

318322
getAllFiles(file, root);
319323
return;

src/sidebarApps/searchInFiles/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function Skip({ exclude, include }) {
237237
function test(file) {
238238
if (!file.path) return false;
239239
const match = (pattern) =>
240-
picomatch(file.path, pattern, { matchBase: true });
240+
picomatch.isMatch(file.path, pattern, { matchBase: true });
241241
return excludeFiles.some(match) || !includeFiles.some(match);
242242
}
243243

0 commit comments

Comments
 (0)