const semver = require('semver'); const { version } = require('../../package.json'); const BuildTypes = { beta: 'beta', flask: 'flask', main: 'main', }; /** * Map the current version to a format that is compatible with each browser. * * The given version number is assumed to be a SemVer version number. Additionally, if the version * has a prerelease component, it is assumed to have the format ". { const versionParts = [major, minor, patch]; const browserSpecificVersion = {}; if (prerelease) { if (platform === 'firefox') { versionParts.push(`${buildType}${buildVersion}`); } else { versionParts.push(buildVersion); browserSpecificVersion.version_name = buildType; } } browserSpecificVersion.version = versionParts.join('.'); platformMap[platform] = browserSpecificVersion; return platformMap; }, {}); } module.exports = { BuildTypes, getBrowserVersionMap, };