Skip to content

Commit f05e384

Browse files
committed
Minor tweaks.
* remove a negated condition * use the regex expression literal instead of the regex constructor
1 parent be15f65 commit f05e384

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ function _resolveIgnoreOpt(ignoreOpt) {
199199
return ignoreOpt;
200200
}
201201

202-
const ignores = !Array.isArray(ignoreOpt) ? [ignoreOpt] : ignoreOpt;
202+
const ignores = Array.isArray(ignoreOpt) ? ignoreOpt : [ignoreOpt];
203203

204204
return ignores.map(ignore => {
205205
const isRegex = ignore[0] === '/' && ignore[ignore.length - 1] === '/';
206206
if (isRegex) {
207207
// Convert user input to regex object
208-
const match = ignore.match(new RegExp('^/(.*)/(.*?)$'));
208+
const match = ignore.match(/^\/(.*)\/(.*?)$/);
209209
return new RegExp(match[1], match[2]);
210210
}
211211

0 commit comments

Comments
 (0)