@@ -52,13 +52,12 @@ const {
52
52
} = require ( 'internal/validators' ) ;
53
53
54
54
const {
55
- getLazy,
56
55
emitExperimentalWarning,
57
56
isWindows,
58
- isMacOS ,
57
+ getLazy ,
59
58
} = require ( 'internal/util' ) ;
60
59
61
- const lazyMinimatch = getLazy ( ( ) => require ( 'internal/deps/minimatch/index ' ) ) ;
60
+ const lazyGlob = getLazy ( ( ) => require ( 'internal/fs/glob ' ) ) . glob ;
62
61
63
62
function isPathSeparator ( code ) {
64
63
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH ;
@@ -164,22 +163,6 @@ function _format(sep, pathObject) {
164
163
return dir === pathObject . root ? `${ dir } ${ base } ` : `${ dir } ${ sep } ${ base } ` ;
165
164
}
166
165
167
- function glob ( path , pattern , windows ) {
168
- emitExperimentalWarning ( 'glob' ) ;
169
- validateString ( path , 'path' ) ;
170
- validateString ( pattern , 'pattern' ) ;
171
- return lazyMinimatch ( ) . minimatch ( path , pattern , {
172
- __proto__ : null ,
173
- nocase : isMacOS || isWindows ,
174
- windowsPathsNoEscape : true ,
175
- nonegate : true ,
176
- nocomment : true ,
177
- optimizationLevel : 2 ,
178
- platform : windows ? 'win32' : 'posix' ,
179
- nocaseMagicOnly : true ,
180
- } ) ;
181
- }
182
-
183
166
const win32 = {
184
167
/**
185
168
* path.resolve([from ...], to)
@@ -1140,7 +1123,8 @@ const win32 = {
1140
1123
} ,
1141
1124
1142
1125
matchesGlob ( path , pattern ) {
1143
- return glob ( path , pattern , true ) ;
1126
+ emitExperimentalWarning ( 'glob' ) ;
1127
+ return lazyGlob ( ) ( path , pattern , true ) ;
1144
1128
} ,
1145
1129
1146
1130
sep : '\\' ,
@@ -1616,7 +1600,8 @@ const posix = {
1616
1600
} ,
1617
1601
1618
1602
matchesGlob ( path , pattern ) {
1619
- return glob ( path , pattern , false ) ;
1603
+ emitExperimentalWarning ( 'glob' ) ;
1604
+ return lazyGlob ( ) ( path , pattern , false ) ;
1620
1605
} ,
1621
1606
1622
1607
sep : '/' ,
0 commit comments