mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
DRY out
This commit is contained in:
parent
6d83ffd060
commit
3d68872a09
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user