fix(utils): set nocase=true for minimatch (#27412)

This commit is contained in:
Rhys Arkins 2024-02-19 10:28:38 +01:00 committed by GitHub
parent 23f3df6216
commit a9946a3b18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -30,6 +30,10 @@ describe('util/string-match', () => {
expect(matchRegexOrGlobList('test', ['test', '!/test3/'])).toBeTrue();
});
it('returns true case insensitive for glob', () => {
expect(matchRegexOrGlobList('TEST', ['t*'])).toBeTrue();
});
it('returns true if matching every negative pattern (regex)', () => {
expect(
matchRegexOrGlobList('test', ['test', '!/test3/', '!/test4/']),

View file

@ -14,7 +14,7 @@ export function getRegexOrGlobPredicate(pattern: string): StringMatchPredicate {
return regExPredicate;
}
const mm = minimatch(pattern, { dot: true });
const mm = minimatch(pattern, { dot: true, nocase: true });
return (x: string): boolean => mm.match(x);
}