Skip to content

Commit 160cad2

Browse files
committed
Merge pull request #39 from peerigon/bugfix/exclude-now-matches-exact-word
bugfix: excluding now matches only a word, not if starting with
2 parents 5e8e2d2 + 7af84a6 commit 160cad2

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

lib/run.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function run(config, done) {
132132
excludedModules = config.exclude.split(",").map(function (name) {
133133
return name.trim();
134134
});
135-
isExcluded = info.name.match(new RegExp("(" + excludedModules.join("|") + ")"), "g");
135+
isExcluded = info.name.match(new RegExp("^(" + excludedModules.join("|") + ")$"));
136136
}
137137

138138
// Check for hyphen in version string as this is a prerelease version according to SemVer

test/run.js

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ var outdatedModulesExclude = {
5757
location: "unicons",
5858
type: "dependencies"
5959
},
60+
"servus.jsShouldNotBeExclued": {
61+
current: "1.1.4",
62+
wanted: "1.1.5",
63+
latest: "2.0.0",
64+
location: "servus.jsShouldNotBeExclued",
65+
type: "dependencies"
66+
},
6067
unicons: {
6168
current: "0.1.4",
6269
wanted: "1.1.5",
@@ -67,17 +74,29 @@ var outdatedModulesExclude = {
6774
};
6875

6976
var expectedOptionsExclude = {
70-
infos: [{
71-
current: "0.1.4",
72-
wanted: "1.1.5",
73-
latest: "2.0.0",
74-
location: "unicons",
75-
type: "dependencies",
76-
name: "unicons",
77-
saveCmd: "--save",
78-
updateTo: "2.0.0"
79-
}],
80-
total: 1
77+
infos: [
78+
{
79+
current: "1.1.4",
80+
wanted: "1.1.5",
81+
latest: "2.0.0",
82+
location: "servus.jsShouldNotBeExclued",
83+
type: "dependencies",
84+
name: "servus.jsShouldNotBeExclued",
85+
saveCmd: "--save",
86+
updateTo: "2.0.0"
87+
},
88+
{
89+
current: "0.1.4",
90+
wanted: "1.1.5",
91+
latest: "2.0.0",
92+
location: "unicons",
93+
type: "dependencies",
94+
name: "unicons",
95+
saveCmd: "--save",
96+
updateTo: "2.0.0"
97+
}
98+
],
99+
total: 2
81100
};
82101

83102
var outdatedModulesUnstable = {

0 commit comments

Comments
 (0)