Allow passing an array of globs to "only" option.
This commit is contained in:
parent
0fc958e0fc
commit
b5325df57f
@ -77,8 +77,7 @@ var compile = function (filename) {
|
||||
};
|
||||
|
||||
var shouldIgnore = function (filename) {
|
||||
filename = slash(filename);
|
||||
return (ignoreRegex && ignoreRegex.test(filename)) || (onlyRegex && !onlyRegex.test(filename));
|
||||
return util.shouldIgnore(filename, ignoreRegex || [], onlyRegex || []);
|
||||
};
|
||||
|
||||
var istanbulMonkey = {};
|
||||
@ -144,8 +143,8 @@ var hookExtensions = function (_exts) {
|
||||
hookExtensions(util.canCompile.EXTENSIONS);
|
||||
|
||||
export default function (opts = {}) {
|
||||
if (opts.only != null) onlyRegex = util.regexify(opts.only);
|
||||
if (opts.ignore != null) ignoreRegex = util.regexify(opts.ignore);
|
||||
if (opts.only != null) onlyRegex = util.arrayify(opts.only, util.regexify);
|
||||
if (opts.ignore != null) ignoreRegex = util.arrayify(opts.ignore, util.regexify);
|
||||
|
||||
if (opts.extensions) hookExtensions(util.arrayify(opts.extensions));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user