-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement all semver methods #3
Comments
Methods used by the SDK
|
Methods used by the CLI
|
LucianBuzzo
added a commit
that referenced
this issue
Sep 14, 2017
Connects to #3 change-type: minor
Merged
LucianBuzzo
added a commit
that referenced
this issue
Sep 14, 2017
Connects to #3 change-type: minor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
valid(v)
: Return the parsed version, or null if it's not valid.inc(v, release)
: Return the version incremented by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if it's not validprerelease(v)
: Returns an array of prerelease components, or null if none exist. Example: prerelease('1.2.3-alpha.1') -> ['alpha', 1]major(v)
: Return the major version number.minor(v)
: Return the minor version number.patch(v)
: Return the patch version number.gt(v1, v2)
: v1 > v2gte(v1, v2)
: v1 >= v2lt(v1, v2)
: v1 < v2lte(v1, v2)
: v1 <= v2eq(v1, v2)
: v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings.neq(v1, v2)
: v1 != v2 The opposite of eq.cmp(v1, comparator, v2)
: Pass in a comparison string, and it'll call the corresponding function above. "===" and "!==" do simple string comparison, but are included for completeness. Throws if an invalid comparison string is provided.compare(v1, v2)
: Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort().rcompare(v1, v2)
: The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort().diff(v1, v2)
: Returns difference between two versions by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if the versions are the same.validRange(range)
: Return the valid range or null if it's not validsatisfies(version, range)
: Return true if the version satisfies the range.maxSatisfying(versions, range)
: Return the highest version in the list that satisfies the range, or null if none of them do.minSatisfying(versions, range)
: Return the lowest version in the list that satisfies the range, or null if none of them do.gtr(version, range)
: Return true if version is greater than all the versions possible in the range.ltr(version, range)
: Return true if version is less than all the versions possible in the range.outside(version, range, hilo)
: Return true if the version is outside the bounds of the range in either the high or low direction. The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.)The text was updated successfully, but these errors were encountered: