um add this util which prob gonna be used in the future

This commit is contained in:
ChomeNS 2022-12-05 12:35:15 +07:00
parent f02784a9fc
commit e0d29d0d9e

View file

@ -0,0 +1,12 @@
/**
* 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('.')
versionArray.pop()
return Number(versionArray.join('.'))
}
module.exports = minecraftVersionToNumber