Skip to content

Commit 8c72042

Browse files
committed
refactor: replace minimatch with picomatch
1 parent 82bf6af commit 8c72042

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib/fileList.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fsOperation from "fileSystem";
22
import toast from "components/toast";
3-
import { minimatch } from "minimatch";
3+
import picomatch from "picomatch/posix";
44
import Url from "utils/Url";
55
import { addedFolder } from "./openFolder";
66
import settings from "./settings";
@@ -311,7 +311,7 @@ async function createChildTree(parent, item, root) {
311311
parent.children.push(file);
312312
if (isDirectory) {
313313
const ignore = !!settings.value.excludeFolders.find((folder) =>
314-
minimatch(Url.join(file.path, ""), folder, { matchBase: true }),
314+
picomatch(Url.join(file.path, ""), folder, { matchBase: true }),
315315
);
316316
if (ignore) return;
317317

src/sidebarApps/searchInFiles/worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "core-js/stable";
2-
import { minimatch } from "minimatch";
2+
import picomatch from "picomatch/posix";
33

44
const resolvers = {};
55

@@ -237,7 +237,7 @@ function Skip({ exclude, include }) {
237237
function test(file) {
238238
if (!file.path) return false;
239239
const match = (pattern) =>
240-
minimatch(file.path, pattern, { matchBase: true });
240+
picomatch(file.path, pattern, { matchBase: true });
241241
return excludeFiles.some(match) || !includeFiles.some(match);
242242
}
243243

0 commit comments

Comments
 (0)