--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
35
node_modules/liftoff/lib/parse_options.js
generated
vendored
Normal file
35
node_modules/liftoff/lib/parse_options.js
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
const extend = require('extend');
|
||||
|
||||
module.exports = function (opts) {
|
||||
var defaults = {
|
||||
extensions: {
|
||||
'.js': null,
|
||||
'.json': null
|
||||
},
|
||||
searchPaths: []
|
||||
};
|
||||
if (!opts) {
|
||||
opts = {};
|
||||
}
|
||||
if (opts.name) {
|
||||
if (!opts.processTitle) {
|
||||
opts.processTitle = opts.name;
|
||||
}
|
||||
if (!opts.configName) {
|
||||
opts.configName = opts.name + 'file';
|
||||
}
|
||||
if (!opts.moduleName) {
|
||||
opts.moduleName = opts.name;
|
||||
}
|
||||
}
|
||||
if (!opts.processTitle) {
|
||||
throw new Error('You must specify a processTitle.');
|
||||
}
|
||||
if (!opts.configName) {
|
||||
throw new Error('You must specify a configName.');
|
||||
}
|
||||
if (!opts.moduleName) {
|
||||
throw new Error('You must specify a moduleName.');
|
||||
}
|
||||
return extend(defaults, opts);
|
||||
};
|
||||
Loading…
Reference in a new issue