Permalink
Browse files

let query() work with invalid semver ranges as exact version matches

  • Loading branch information...
1 parent 7b79bda commit d1564077efe5b2529c54c87de096ebb546597d31 @substack committed Mar 6, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 index.js
View
@@ -273,6 +273,11 @@ exports.createServer = function (opts) {
if (version === undefined) {
return roles[role] || [];
}
+ else if (!semver.validRange(version)) {
+ return (roles[role] || []).filter(function (r) {
+ return version === r.version;
+ });
+ }
else {
return (roles[role] || []).filter(function (r) {
return semver.satisfies(r.version, version);

0 comments on commit d156407

Please sign in to comment.