mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-30 10:56:55 -05:00
e1a1d92723
this somehow took 1 hour(?)
13 lines
425 B
JavaScript
13 lines
425 B
JavaScript
/**
|
|
* converts minecraft version to number (for example '1.19.2' will be 1.19)
|
|
* @param {String} version
|
|
* @return {Number} decimal number of the version you specified
|
|
*/
|
|
function minecraftVersionToNumber (version) {
|
|
const versionArray = version.split('.')
|
|
if (versionArray.length === 2) return Number(version)
|
|
versionArray.pop()
|
|
return Number(versionArray.join('.'))
|
|
}
|
|
|
|
module.exports = minecraftVersionToNumber
|