Skip to content

Commit

Permalink
fix: match items with leading "./" and trailing "+ N modules"
Browse files Browse the repository at this point in the history
This allows "**/*.jsx" to match "./src/main.jsx + 751 modules"
  • Loading branch information
dominykas authored and d4rkr00t committed Jul 8, 2019
1 parent efce7bc commit 4686f11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion commands/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ module.exports = function defaultCommand(

const ignore = flags.ignore ? flags.ignore.split(",") : [];
const report = analyze(stats, ignore, updateProgressBar);

const format = str =>
str.replace(/^\.\//, "").replace(/ \+ \d+ modules$/, "");

const modules = report.modules.filter(module => {
if (pattern && mm.isMatch(module.name, pattern)) {
if (pattern && mm.isMatch(module.name, pattern, { format })) {
return true;
} else if (pattern) {
return false;
Expand Down

0 comments on commit 4686f11

Please sign in to comment.