From b5325df57f45d01d5a325ca08da0fa007597bc48 Mon Sep 17 00:00:00 2001 From: Mark-Simulacrum Date: Tue, 28 Apr 2015 17:59:20 -0600 Subject: [PATCH] Allow passing an array of globs to "only" option. --- src/babel/api/register/node.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/babel/api/register/node.js b/src/babel/api/register/node.js index b601dd880f..fad96782d7 100644 --- a/src/babel/api/register/node.js +++ b/src/babel/api/register/node.js @@ -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));