File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 10
10
// Requirements
11
11
// ------------------------------------------------------------------------------
12
12
13
- const { minimatch } = require ( 'minimatch' )
14
- const Minimatch = minimatch . Minimatch
13
+ const picomatch = require ( 'picomatch' )
15
14
16
15
// ------------------------------------------------------------------------------
17
16
// Helpers
@@ -21,7 +20,7 @@ const COLON_OR_SLASH = /[:/]/g
21
20
const CONVERT_MAP = { ':' : '/' , '/' : ':' }
22
21
23
22
/**
24
- * Swaps ":" and "/", in order to use ":" as the separator in minimatch .
23
+ * Swaps ":" and "/", in order to use ":" as the separator in picomatch .
25
24
*
26
25
* @param {string } s - A text to swap.
27
26
* @returns {string } The text which was swapped.
@@ -44,8 +43,10 @@ function createFilter (pattern) {
44
43
const spacePos = trimmed . indexOf ( ' ' )
45
44
const task = spacePos < 0 ? trimmed : trimmed . slice ( 0 , spacePos )
46
45
const args = spacePos < 0 ? '' : trimmed . slice ( spacePos )
47
- const matcher = new Minimatch ( swapColonAndSlash ( task ) , { nonegate : true } )
48
- const match = matcher . match . bind ( matcher )
46
+ const match = picomatch ( swapColonAndSlash ( task ) , {
47
+ nonegate : true ,
48
+ strictSlashes : true ,
49
+ } )
49
50
50
51
return { match, task, args }
51
52
}
You can’t perform that action at this time.
0 commit comments