1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/development/build/utils.js

33 lines
789 B
JavaScript
Raw Normal View History

/**
* @returns {Object} An object with browser as key and next version of beta
* as the value. E.g. { firefox: '9.6.0.beta0', chrome: '9.6.0.1' }
*/
function getNextBetaVersionMap(currentVersion, betaVersion, platforms) {
2021-09-08 22:08:23 +02:00
const [major, minor] = currentVersion.split('.');
return platforms.reduce((platformMap, platform) => {
platformMap[platform] = [
// Keeps the current major
major,
// Bump the minor version
Number(minor) + 1,
// This isn't typically used
0,
// The beta number
`${platform === 'firefox' ? 'beta' : ''}${betaVersion}`,
2021-09-08 22:08:23 +02:00
].join('.');
return platformMap;
}, {});
}
const BuildTypes = {
beta: 'beta',
flask: 'flask',
main: 'main',
};
2021-09-08 22:08:23 +02:00
module.exports = {
BuildTypes,
2021-09-08 22:08:23 +02:00
getNextBetaVersionMap,
};