diff --git a/index.js b/index.js index 538c1db..d648ab2 100644 --- a/index.js +++ b/index.js @@ -132,7 +132,7 @@ module.exports = (options = {}) => { exclude && ((type.isFunction(exclude) && exclude(filePath)) || (type.isString(exclude) && filePath.indexOf(exclude) !== -1) || - filePath.match(exclude) !== null) + (type.isRegExp(exclude) && filePath.match(exclude) !== null)) ) { isExcludeFile = true; } else { diff --git a/lib/type.js b/lib/type.js index dda695f..429864a 100644 --- a/lib/type.js +++ b/lib/type.js @@ -12,7 +12,8 @@ const types = [ "Number", "Function", "Symbol", - "Object" + "Object", + "RegExp" ]; module.exports = types.reduce((acc, str) => {