UNPKG

513 BTypeScriptView Raw
1import semver = require('../index');
2import SemVer = require('../classes/semver');
3
4/**
5 * Compares two versions excluding build identifiers (the bit after `+` in the semantic version string).
6 *
7 * Sorts in ascending order when passed to `Array.sort()`.
8 *
9 * @return
10 * - `0` if `v1` == `v2`
11 * - `1` if `v1` is greater
12 * - `-1` if `v2` is greater.
13 */
14declare function compare(
15 v1: string | SemVer,
16 v2: string | SemVer,
17 optionsOrLoose?: boolean | semver.Options,
18): 1 | 0 | -1;
19
20export = compare;