mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-20 13:36:20 +00:00
Ensured server version is properly parsed to avoid errors due to invalid semver
This commit is contained in:
@@ -60,3 +60,11 @@ export const compareVersions = (firstVersion, operator, secondVersion) => compar
|
||||
secondVersion,
|
||||
operator
|
||||
);
|
||||
|
||||
export const versionIsValidSemVer = (version) => {
|
||||
try {
|
||||
return compareVersions(version, '=', version);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user