Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

maxSatisfying() should return null if no versions satisfy the range #23

Closed
wants to merge 1 commit into from

2 participants

@sethkinast

Trivial patch for issue #20 as requested

@sethkinast sethkinast maxSatisfying() should return null if no versions satisfy the range. …
…Fixes #20

Keep maxSatisfying comment in sync with behavior
2c66f7a
@isaacs
Owner

Landed on 160e5ae. Thanks!

@isaacs isaacs closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 6, 2013
  1. @sethkinast

    maxSatisfying() should return null if no versions satisfy the range. …

    sethkinast authored Seth Kinast committed
    …Fixes #20
    
    Keep maxSatisfying comment in sync with behavior
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 semver.js
View
4 semver.js
@@ -192,12 +192,12 @@ function validRange (range) {
: c.map(function (c) { return c.join(" ") }).join("||")
}
-// returns the highest satisfying version in the list, or undefined
+// returns the highest satisfying version in the list, or null
function maxSatisfying (versions, range) {
return versions
.filter(function (v) { return satisfies(v, range) })
.sort(compare)
- .pop()
+ .pop() || null
}
function satisfies (version, range) {
version = valid(version)
Something went wrong with that request. Please try again.