mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 21:31:12 +08:00
update: Update semver definitions to support v5.3.0
This commit is contained in:
@@ -27,6 +27,7 @@ str = mod.inc(str, str, loose);
|
||||
num = mod.major(str, loose);
|
||||
num = mod.minor(str, loose);
|
||||
num = mod.patch(str, loose);
|
||||
strArr = mod.prerelease(str, loose);
|
||||
|
||||
// Comparison
|
||||
bool = mod.gt(v1, v2, loose);
|
||||
@@ -44,6 +45,7 @@ diff = mod.diff(v1, v2, loose);
|
||||
str = mod.validRange(str, loose);
|
||||
bool = mod.satisfies(version, str, loose);
|
||||
str = mod.maxSatisfying(versions, str, loose);
|
||||
str = mod.minSatisfying(versions, str, loose);
|
||||
bool = mod.gtr(version, str, loose);
|
||||
bool = mod.ltr(version, str, loose);
|
||||
bool = mod.outside(version, str, str, loose);
|
||||
|
||||
10
semver/semver.d.ts
vendored
10
semver/semver.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for semver v4.3.4
|
||||
// Type definitions for semver v5.3.0
|
||||
// Project: https://github.com/npm/node-semver
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/semver
|
||||
@@ -28,6 +28,10 @@ declare namespace SemVerModule {
|
||||
* Return the patch version number.
|
||||
*/
|
||||
function patch(v: string, loose?: boolean): number;
|
||||
/**
|
||||
* Returns an array of prerelease components, or null if none exist.
|
||||
*/
|
||||
function prerelease(v: string, loose?: boolean): string[];
|
||||
|
||||
// Comparison
|
||||
/**
|
||||
@@ -84,6 +88,10 @@ declare namespace SemVerModule {
|
||||
* Return the highest version in the list that satisfies the range, or null if none of them do.
|
||||
*/
|
||||
function maxSatisfying(versions: string[], range: string, loose?: boolean): string;
|
||||
/**
|
||||
* Return the lowest version in the list that satisfies the range, or null if none of them do.
|
||||
*/
|
||||
function minSatisfying(versions: string[], range: string, loose?: boolean): string;
|
||||
/**
|
||||
* Return true if version is greater than all the versions possible in the range.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user