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;
function makeRegExp(config) {
var regExp = null;
if (config) {
regExp = (typeof config === 'string') ? new RegExp(config) : config;
}
return regExp;
}
/**
@constructor
@param {object} opts
@ -24,12 +34,8 @@ exports.Filter = function(opts) {
return path.resolve(pwd, $);
}) :
null;
this.includePattern = opts.includePattern?
typeof opts.includePattern === 'string'? new RegExp(opts.includePattern) : opts.includePattern
: null;
this.excludePattern = opts.excludePattern?
typeof opts.excludePattern === 'string'? new RegExp(opts.excludePattern) : opts.excludePattern
: null;
this.includePattern = makeRegExp(opts.includePattern);
this.excludePattern = makeRegExp(opts.excludePattern);
};
/**