File tree 1 file changed +10
-11
lines changed
1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,15 @@ import lodash from "lodash";
7
7
* @return {boolean }
8
8
*/
9
9
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
+ } ) ;
20
19
}
21
20
22
21
/**
@@ -28,7 +27,7 @@ function isPathSupported(pathObject, filterObjects) {
28
27
*/
29
28
function isMultiPathSupported ( pathObject , multiPathSeparator , filterObjects ) {
30
29
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 ) ) ;
32
31
}
33
32
34
33
/**
You can’t perform that action at this time.
0 commit comments