fix options default
This commit is contained in:
parent
0c4ccc3b43
commit
1534917132
10
index.js
10
index.js
@ -8,10 +8,12 @@ const path = require('path');
|
||||
* @param {string} modulefolder folder that contains all modules
|
||||
* @param {{opts: any, subdir: string, verbose: boolean}} options
|
||||
*/
|
||||
module.exports = function (app, modulefolder, options) {
|
||||
let { opts, subdir, verbose } = options;
|
||||
if (typeof subdir === 'undefined') subdir = '';
|
||||
if (typeof verbose === 'undefined') verbose = false;
|
||||
module.exports = function (
|
||||
app,
|
||||
modulefolder,
|
||||
options = { opts: undefined, subdir: '', verbose: false }
|
||||
) {
|
||||
const { opts, subdir, verbose } = options;
|
||||
|
||||
for (const f of fs.readdirSync(modulefolder)) {
|
||||
const regex = /(.*?)-(.*?)\.js/;
|
||||
|
Reference in New Issue
Block a user