console semver fix for commits on master branch (#1131)

This commit is contained in:
Rishichandra Wawhal 2018-11-28 15:20:55 +05:30 committed by Shahidh K Muhammed
parent db1f6c1a39
commit 7f56da9f28
2 changed files with 5 additions and 4 deletions

View File

@ -1,3 +1 @@
const SERVER_CONSOLE_MODE = 'server';
export { SERVER_CONSOLE_MODE };
export const SERVER_CONSOLE_MODE = 'server';

View File

@ -16,12 +16,15 @@ const componentsSemver = {
const getPreRelease = version => {
const prerelease = semver.prerelease(version);
if (!prerelease) {
return '';
}
if (prerelease.length === 1) {
const regex = /(alpha|beta)(\d+)/gm;
const str = prerelease[0];
const m = regex.exec(str);
if (m.length < 3) {
return [];
return '';
}
return m.slice(1, 3);
}