Kind: Class
Source: atloria-monorepo/libs/parser-core/src/generators/versioning/version-config.ts
Version utilities
Methods
| Method | Signature | Returns |
|---|---|---|
parseVersion | parseVersion(version: string) | `[number, number, number] |
compare | compare(a: string, b: string) | VersionComparison |
sort | sort(versions: VersionInfo[], ascending: undefined) | VersionInfo[] |
findLatest | findLatest(versions: VersionInfo[], includePrerelease: undefined) | `VersionInfo |
isPrerelease | isPrerelease(version: string) | boolean |
isEOL | isEOL(version: VersionInfo) | boolean |
generateLabel | generateLabel(version: VersionInfo, isLatest: boolean) | string |
groupByMajor | groupByMajor(versions: VersionInfo[]) | Map<number, VersionInfo[]> |
getBadgeColor | getBadgeColor(version: VersionInfo) | string |
Where it refuses work
VersionUtilsstops the work with an early return whenparts.length !== 3.VersionUtilsstops the work with an early return whenisNaN(major) || isNaN(minor) || isNaN(patch).VersionUtilsstops the work with an early return when!versionA || !versionB.VersionUtilsstops the work with an early return whenversionA[i] < versionB[i].VersionUtilsstops the work with an early return whenversionA[i] > versionB[i].VersionUtilsstops the work with an early return whencandidates.length === 0.
Was this page helpful?