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 {string} modulefolder folder that contains all modules
|
||||||
* @param {{opts: any, subdir: string, verbose: boolean}} options
|
* @param {{opts: any, subdir: string, verbose: boolean}} options
|
||||||
*/
|
*/
|
||||||
module.exports = function (app, modulefolder, options) {
|
module.exports = function (
|
||||||
let { opts, subdir, verbose } = options;
|
app,
|
||||||
if (typeof subdir === 'undefined') subdir = '';
|
modulefolder,
|
||||||
if (typeof verbose === 'undefined') verbose = false;
|
options = { opts: undefined, subdir: '', verbose: false }
|
||||||
|
) {
|
||||||
|
const { opts, subdir, verbose } = options;
|
||||||
|
|
||||||
for (const f of fs.readdirSync(modulefolder)) {
|
for (const f of fs.readdirSync(modulefolder)) {
|
||||||
const regex = /(.*?)-(.*?)\.js/;
|
const regex = /(.*?)-(.*?)\.js/;
|
||||||
|
Reference in New Issue
Block a user