fix shouldIgnore only matches switch

This commit is contained in:
Sebastian McKenzie 2015-05-15 01:57:10 +01:00
parent 36ad1108b4
commit b89cf6768f

View File

@ -114,8 +114,8 @@ export function shouldIgnore(filename, ignore, only) {
if (only.length) { if (only.length) {
var matches = false; var matches = false;
for (var pattern of (only: Array)) {
for (let filename of (filenames: Array)) { for (let filename of (filenames: Array)) {
for (var pattern of (only: Array)) {
if (pattern.test(filename)) { if (pattern.test(filename)) {
matches = true; matches = true;
break; break;
@ -123,7 +123,7 @@ export function shouldIgnore(filename, ignore, only) {
} }
} }
return matches; return !matches;
} else if (ignore.length) { } else if (ignore.length) {
for (let filename of (filenames: Array)) { for (let filename of (filenames: Array)) {
for (var pattern of (ignore: Array)) { for (var pattern of (ignore: Array)) {