This commit is contained in:
Jeff Williams 2013-12-26 21:26:19 -08:00
parent 6d83ffd060
commit 3d68872a09

View File

@ -11,6 +11,16 @@ var path = require('jsdoc/path');
var pwd = env.pwd; var pwd = env.pwd;
function makeRegExp(config) {
var regExp = null;
if (config) {
regExp = (typeof config === 'string') ? new RegExp(config) : config;
}
return regExp;
}
/** /**
@constructor @constructor
@param {object} opts @param {object} opts
@ -24,12 +34,8 @@ exports.Filter = function(opts) {
return path.resolve(pwd, $); return path.resolve(pwd, $);
}) : }) :
null; null;
this.includePattern = opts.includePattern? this.includePattern = makeRegExp(opts.includePattern);
typeof opts.includePattern === 'string'? new RegExp(opts.includePattern) : opts.includePattern this.excludePattern = makeRegExp(opts.excludePattern);
: null;
this.excludePattern = opts.excludePattern?
typeof opts.excludePattern === 'string'? new RegExp(opts.excludePattern) : opts.excludePattern
: null;
}; };
/** /**