-
Notifications
You must be signed in to change notification settings - Fork 0
from
Subhajit Sahu edited this page May 31, 2020
·
7 revisions
Converts value to version. 🏃 📼 📦 🌔 📒
version.from(v);
// v: a value
// --> version, or null
const version = require('extra-version');
var x = version.from('1.2');
x.toString();
// '1.2.0'
var x = version.from(1.2);
x.toString();
// '1.2.0'
var x = version.from('v1.2.3.4');
x.toString();
// '1.2.3+4'
var x = version.from('v1.2.3-beta.1+sha.5114f85');
x;
// Version {
// major: 1,
// minor: 2,
// patch: 3,
// prerelease: [ 'beta', '1' ],
// buildmetadata: [ 'sha', '5114f85' ]
// }