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;
|
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;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user