mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-02 05:23:14 +00:00
* chore: update packages (#3132) * chore: update packages * start tunnel messaging * chore: standalone * pbpaste instead --------- Co-authored-by: Matt Hill <mattnine@protonmail.com> * port labels and move logout to settings * enable-disable forwards * Fix docs URLs in start-tunnel installer output (#3135) --------- Co-authored-by: Alex Inkin <alexander@inkin.ru> Co-authored-by: gStart9 <106188942+gStart9@users.noreply.github.com>
21 lines
688 B
TypeScript
21 lines
688 B
TypeScript
import { inject, Pipe, PipeTransform } from '@angular/core'
|
|
import { Exver } from '../services/exver.service'
|
|
|
|
@Pipe({
|
|
name: 'compareExver',
|
|
})
|
|
export class ExverComparesPipe implements PipeTransform {
|
|
private readonly exver = inject(Exver)
|
|
|
|
transform(first: string, second: string): SemverResult {
|
|
try {
|
|
return this.exver.compareExver(first, second) as SemverResult
|
|
} catch (e) {
|
|
console.error(`exver comparison failed`, e, first, second)
|
|
return 'comparison-impossible'
|
|
}
|
|
}
|
|
}
|
|
// left compared to right - if 1, version on left is higher; if 0, values the same; if -1, version on left is lower
|
|
type SemverResult = 0 | 1 | -1 | 'comparison-impossible'
|