fix options default

This commit is contained in:
Timo Hocker 2019-12-11 12:57:05 +01:00
parent 0c4ccc3b43
commit 1534917132

View File

@ -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/;