diff options
author | isaacs <i@izs.me> | 2010-05-03 07:00:35 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-05-03 07:00:47 +0400 |
commit | 84fc560ae527dd1f0d75594e0b444dae6236127b (patch) | |
tree | f79a83d9f76e594d6ee32dba81bd37f129f85cf1 /lib | |
parent | bf0c956b7535484fe46640276a27e799b0a728b3 (diff) |
prefer string.match to regexp.exec
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/semver.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utils/semver.js b/lib/utils/semver.js index e99c01e3c..1294a0239 100644 --- a/lib/utils/semver.js +++ b/lib/utils/semver.js @@ -24,7 +24,7 @@ exports.maxSatisfying = maxSatisfying function valid (version) { return exports.parse(version) && version.trim() } function validPackage (version) { - return exports.parsePackage(version) && version.trim() + return version.match(exports.parsePackage) && version.trim() } // range can be one of: @@ -44,7 +44,7 @@ function toComparators (range) { .replace(compTrimExpression, compTrimReplace) .replace(starExpression, starReplace) .split(/\s+/) - .filter(function (c) { return exports.validComparator(c) }) + .filter(function (c) { return c.match(exports.validComparator) }) } function validRange (range) { |