Skip to content

Commit e1de8b1

Browse files
committed
Fix exclusion patterns
1 parent 6f11e26 commit e1de8b1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Utils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,14 @@ export class Utils {
133133
pattern = pattern.substring(0, pattern.length - 1);
134134
}
135135

136-
137136
if (startsWithWildcard && endsWithWildcard)
138137
return value.indexOf(pattern) !== -1;
139138

140139
if (startsWithWildcard)
141-
return value.lastIndexOf(pattern, 0) !== -1;
140+
return value.lastIndexOf(pattern) === (value.length - pattern.length);
142141

143142
if (endsWithWildcard)
144-
return value.lastIndexOf(pattern) === (value.length - pattern.length);
143+
return value.indexOf(pattern) === 0;
145144

146145
return value === pattern;
147146
}

0 commit comments

Comments
 (0)