Skip to content

Commit

Permalink
Fix bug with --extensions not working
Browse files Browse the repository at this point in the history
  • Loading branch information
pahen committed Jul 15, 2017
1 parent 1f99940 commit fc4acce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const log = require('./log');
const defaultConfig = {
baseDir: null,
excludeRegExp: false,
extensions: ['js'],
showFileExtension: false,
fileExtensions: ['js'],
includeNpm: false,
requireConfig: null,
webpackConfig: null,
Expand Down
10 changes: 5 additions & 5 deletions lib/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ module.exports.circular = function (spinner, res, circular, opts) {
};

/**
* Print the result from Madge.depends().
* @param {Array} depends
* Print the given modules.
* @param {Array} modules
* @param {Object} opts
* @return {undefined}
*/
module.exports.depends = function (depends, opts) {
module.exports.modules = function (modules, opts) {
if (opts.json) {
return printJSON(depends);
return printJSON(modules);
}

depends.forEach((id) => {
modules.forEach((id) => {
console.log(chalk.cyan.bold(id));
});
};
Expand Down
2 changes: 1 addition & 1 deletion lib/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Tree {

const ext = path.extname(filePath).replace('.', '');

if (files.indexOf(filePath) < 0 && this.config.extensions.indexOf(ext) >= 0) {
if (files.indexOf(filePath) < 0 && this.config.fileExtensions.indexOf(ext) >= 0) {
files.push(filePath);
}
});
Expand Down

0 comments on commit fc4acce

Please sign in to comment.