mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 20:24:47 +00:00
add from and to arguments
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { matches } from "../dependencies.ts";
|
||||
|
||||
const starSub = /((\d+\.)*\d+)\.\*/;
|
||||
|
||||
function incrementLastNumber(list: number[]) {
|
||||
@@ -123,15 +125,22 @@ export class EmVer {
|
||||
public lessThan(other: EmVer): boolean {
|
||||
return !this.greaterThanOrEqual(other);
|
||||
}
|
||||
public compare(other: EmVer): number {
|
||||
public compare(other: EmVer) {
|
||||
if (this.equals(other)) {
|
||||
return 0;
|
||||
return "equal" as const;
|
||||
} else if (this.greaterThan(other)) {
|
||||
return 1;
|
||||
return "greater" as const;
|
||||
} else {
|
||||
return -1;
|
||||
return "less" as const;
|
||||
}
|
||||
}
|
||||
public compareForSort(other: EmVer) {
|
||||
return matches.matches(this.compare(other))
|
||||
.when("equal", () => 0 as const)
|
||||
.when("greater", () => 1 as const)
|
||||
.when("less", () => -1 as const)
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user