is-semver
Version:
Check if an input value is a valid semver version or not.
16 lines (14 loc) • 390 B
JavaScript
;
var valid = require("semver/functions/valid");
/**
* isSemver
* Checks if the input value is a valid semver version.
*
* @name isSemver
* @function
* @param {String} input The input value.
* @return {Boolean} Returns `true` if the input is a valid semver version or `false` otherwise.
*/
module.exports = function isSemver(input) {
return valid(input) !== null;
};