mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add unit tests for VersionRange (#40114)
* Add unit tests for VersionRange Make it easier to understand the intended semantics next time I have to read this code. * I miss prettier
This commit is contained in:
1 parent
dbab46c363
commit
6fea7ff536
2 files changed
+26
-3
No files matched your search
@@ -84,7 +84,7 @@ namespace ts {
|
||||
return compareValues(this.major, other.major)
|
||||
|| compareValues(this.minor, other.minor)
|
||||
|| compareValues(this.patch, other.patch)
|
||||
|| comparePrerelaseIdentifiers(this.prerelease, other.prerelease);
|
||||
|| comparePrereleaseIdentifiers(this.prerelease, other.prerelease);
|
||||
}
|
||||
|
||||
increment(field: "major" | "minor" | "patch") {
|
||||
@@ -120,7 +120,7 @@ namespace ts {
|
||||
};
|
||||
}
|
||||
|
||||
function comparePrerelaseIdentifiers(left: readonly string[], right: readonly string[]) {
|
||||
function comparePrereleaseIdentifiers(left: readonly string[], right: readonly string[]) {
|
||||
// https://semver.org/#spec-item-11
|
||||
// > When major, minor, and patch are equal, a pre-release version has lower precedence
|
||||
// > than a normal version.
|
||||
@@ -388,4 +388,4 @@ namespace ts {
|
||||
function formatComparator(comparator: Comparator) {
|
||||
return `${comparator.operator}${comparator.operand}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user