Skip to content

Commit

Permalink
fix(utils): set nocase=true for minimatch (#27412)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins authored Feb 19, 2024
1 parent 23f3df6 commit a9946a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/util/string-match.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/']),
Expand Down
2 changes: 1 addition & 1 deletion lib/util/string-match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a9946a3

Please sign in to comment.