File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ function wrapRelativePattern(parsedPattern: ParsedStringPattern, arg2: string |
357
357
return parsedPattern ;
358
358
}
359
359
360
- return function ( path , basename ) {
360
+ const wrappedPattern : ParsedStringPattern = function ( path , basename ) {
361
361
if ( ! isEqualOrParent ( path , arg2 . base , ! isLinux ) ) {
362
362
// skip glob matching if `base` is not a parent of `path`
363
363
return null ;
@@ -368,6 +368,14 @@ function wrapRelativePattern(parsedPattern: ParsedStringPattern, arg2: string |
368
368
// and only match on the remaining path components
369
369
return parsedPattern ( path . substr ( arg2 . base . length + 1 ) , basename ) ;
370
370
} ;
371
+
372
+ // Make sure to preserve associated metadata
373
+ wrappedPattern . allBasenames = parsedPattern . allBasenames ;
374
+ wrappedPattern . allPaths = parsedPattern . allPaths ;
375
+ wrappedPattern . basenames = parsedPattern . basenames ;
376
+ wrappedPattern . patterns = parsedPattern . patterns ;
377
+
378
+ return wrappedPattern ;
371
379
}
372
380
373
381
function trimForExclusions ( pattern : string , options : IGlobOptions ) : string {
You can’t perform that action at this time.
0 commit comments