fix options default
This commit is contained in:
		
							
								
								
									
										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