Skip to content

Commit 5ba232e

Browse files
committed
chore: use pure JS where possible
1 parent b0b3a6e commit 5ba232e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/utils/filter.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ import lodash from "lodash";
77
* @return {boolean}
88
*/
99
function isPathSupported(pathObject, filterObjects) {
10-
return (
11-
lodash.find(filterObjects, (filterObj) => {
12-
if (filterObj.path) {
13-
return filterObj.path === pathObject.path;
14-
}
15-
if (filterObj.regex) {
16-
return filterObj.regex.test(pathObject.path);
17-
}
18-
}) !== undefined
19-
);
10+
return filterObjects.some((filterObj) => {
11+
if (filterObj.path) {
12+
return filterObj.path === pathObject.path;
13+
}
14+
if (filterObj.regex) {
15+
return filterObj.regex.test(pathObject.path);
16+
}
17+
return false;
18+
});
2019
}
2120

2221
/**
@@ -28,7 +27,7 @@ function isPathSupported(pathObject, filterObjects) {
2827
*/
2928
function isMultiPathSupported(pathObject, multiPathSeparator, filterObjects) {
3029
const expandedPaths = pathObject.path.split(multiPathSeparator).map((p) => ({ path: p }));
31-
return lodash.every(expandedPaths, (obj) => isPathSupported(obj, filterObjects));
30+
return expandedPaths.every((expandedPath) => isPathSupported(expandedPath, filterObjects));
3231
}
3332

3433
/**

0 commit comments

Comments
 (0)