added missing stringify function

This commit is contained in:
AJ ONeal 2013-04-24 17:48:16 -06:00
parent 38f8d713a1
commit 65c47649af
2 changed files with 17 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "semver-utils", "name": "semver-utils",
"version": "1.0.0", "version": "1.0.1",
"description": "Tools for manipulating semver strings and objects", "description": "Tools for manipulating semver strings and objects",
"main": "semver-utils.js", "main": "semver-utils.js",
"scripts": { "scripts": {

View File

@ -29,6 +29,21 @@
return ver; return ver;
} }
function stringifySemver(obj) {
var str = '';
str += obj.major || '0';
str += '.';
str += obj.minor || '0';
str += '.';
str += obj.patch || '0';
if (obj.release) {
str += '-' + obj.release;
}
if (obj.build) {
str += '+' + obj.build;
}
}
function parseSemverRange(str) { function parseSemverRange(str) {
var m var m
, arr = [] , arr = []
@ -68,5 +83,6 @@
} }
module.exports.parse = parseSemver; module.exports.parse = parseSemver;
module.exports.stringify = stringifySemver;
module.exports.parseRange = parseSemverRange; module.exports.parseRange = parseSemverRange;
}()); }());