]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - shared/core-utils/common/version.ts
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / shared / core-utils / common / version.ts
... / ...
CommitLineData
1// Thanks https://gist.github.com/iwill/a83038623ba4fef6abb9efca87ae9ccb
2function compareSemVer (a: string, b: string) {
3 if (a.startsWith(b + '-')) return -1
4 if (b.startsWith(a + '-')) return 1
5
6 return a.localeCompare(b, undefined, { numeric: true, sensitivity: 'case', caseFirst: 'upper' })
7}
8
9export {
10 compareSemVer
11}