Skip to content

Commit 7d7e1dd

Browse files
Merge pull request #296 from peterbe/case-insensitive-prefixsuffix-regexes
feat: case-insensitive prefix/suffix regexes
2 parents ac1d726 + c0b379d commit 7d7e1dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ export const escapeRegExp = (text: string): string => text.replace(/[.*+?^${}()|
9797

9898
export const getRegExp = (value: string): RegExp => new RegExp(escapeRegExp(value));
9999

100-
export const getPrefixRegExp = (value: string): RegExp => new RegExp('^' + escapeRegExp(value));
100+
export const getPrefixRegExp = (value: string): RegExp => new RegExp('^' + escapeRegExp(value), 'i');
101101

102-
export const getSuffixRegExp = (value: string): RegExp => new RegExp(escapeRegExp(value) + '$');
102+
export const getSuffixRegExp = (value: string): RegExp => new RegExp(escapeRegExp(value) + '$', 'i');
103103

104104
export const getBoolValue = (input: string): boolean => !['false', '0', '', 'no', 'n'].includes(input.trim().toLowerCase());
105105

0 commit comments

Comments
 (0)