* (ui): fix the version check - strip the v prefix
This commit is contained in:
17
client/src/helpers/version.js
Normal file
17
client/src/helpers/version.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Checks if versions are equal.
|
||||
* Please note, that this method strips the "v" prefix.
|
||||
*
|
||||
* @param left {string} - left version
|
||||
* @param right {string} - right version
|
||||
* @return {boolean} true if versions are equal
|
||||
*/
|
||||
export const areEqualVersions = (left, right) => {
|
||||
if (!left || !right) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const leftVersion = left.replace(/^v/, '');
|
||||
const rightVersion = right.replace(/^v/, '');
|
||||
return leftVersion === rightVersion;
|
||||
};
|
||||
Reference in New Issue
Block a user