mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 00:08:10 -05:00
graphite: auto detect version
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
const versionPattern = /(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-([0-9A-Za-z\.]+))?/;
|
||||
import _ from 'lodash';
|
||||
|
||||
const versionPattern = /^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-([0-9A-Za-z\.]+))?/;
|
||||
|
||||
export class SemVersion {
|
||||
major: number;
|
||||
@@ -20,6 +22,10 @@ export class SemVersion {
|
||||
let compared = new SemVersion(version);
|
||||
return !(this.major < compared.major || this.minor < compared.minor || this.patch < compared.patch);
|
||||
}
|
||||
|
||||
isValid(): boolean {
|
||||
return _.isNumber(this.major);
|
||||
}
|
||||
}
|
||||
|
||||
export function isVersionGtOrEq(a: string, b: string): boolean {
|
||||
|
||||
Reference in New Issue
Block a user