Improve code as per Sonar suggestions (#22224)
This commit is contained in:
parent
0292f66365
commit
ca98529bd2
11 changed files with 465 additions and 331 deletions
|
@ -106,11 +106,10 @@ export default class WebPlatform extends VectorBasePlatform {
|
|||
}
|
||||
|
||||
getNormalizedAppVersion(version: string): string {
|
||||
// if version looks like semver with leading v, strip it
|
||||
// (matches scripts/normalize-version.sh)
|
||||
const semVerRegex = new RegExp("^v[0-9]+.[0-9]+.[0-9]+(-.+)?$");
|
||||
// if version looks like semver with leading v, strip it (matches scripts/normalize-version.sh)
|
||||
const semVerRegex = /^v\d+.\d+.\d+(-.+)?$/;
|
||||
if (semVerRegex.test(version)) {
|
||||
return version.substr(1);
|
||||
return version.substring(1);
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue