const isValidVersion = input => Boolean(semver.valid(input))
if (semver.valid(options.drush) && semver.major(options.drush) === 8) { delete options.composer['drush/drush']; options.build.unshift(utils.getDrush(options.drush, ['drush', '--version'])); const coercedDrushVersion = semver.valid(semver.coerce(options.drush)); if (!_.isNull(coercedDrushVersion) && semver.gte(coercedDrushVersion, '10.0.0')) { options._app.addWarning(warnings.drushWarn(options.drush));
version = parts.join('.'); return semver.valid(semver.coerce(version, true)); };
const newVersion = response.version; const currentBranch = branchName(); if (!valid(newVersion)) { console.log(chalk.red('Invalid version mate. Try again')); process.exit(1);
exec('node --version', (error, stdout, stderr) => { if (error) return cb(error, null) const output = (stdout + stderr).replace(/(\r\n|\n|\r| )/gm, '') const sem = semver.valid(output) if (sem) return cb(null, sem) cb(new Error(output), null) })
function semverify (versionlike) { let cleaned = semver.valid(semver.coerce(versionlike)) if (cleaned === null) { cleaned = versionlike } return cleaned }
test('package', function (t) { // these values are in the User-Agent header tests, so we need to make sure // they are as we expect t.equal(pkg.name, 'elastic-apm-http-client') t.ok(semver.valid(pkg.version)) t.end() })
list.forEach((str) => { if (str.split('\t').length === 1) return const hash = str.split('\t')[0].slice(0, 6) const version = str.split('\t')[1].replace('refs/tags/', '') if (version.match(/\^\{\}/)) return if (!semver.valid(version)) return if (semver.satisfies(version, range)) hosted.committish = hash })
async removeOldVersions({instance}, task) { const semver = require('semver'); const versionDirs = await fs.readdir(path.join(instance.dir, 'versions')); const versions = versionDirs.filter(semver.valid).sort(semver.compare); if (versions.length <= 2) { task.skip(); return; } const promises = versions.slice(0, -2) .map(version => fs.remove(path.join(instance.dir, 'versions', version))); await Promise.all(promises); }
const parseTags = data => { return _.compact(data.split('\n')) .filter(semver.valid) .sort(semver.compare) .reverse(); }
[...targetList].reduce((list, dependency) => { const version = dependencies[dependency]; if (!semver.valid(version)) { list.push({ dependency, version }); } return list; }, [])
valid () { return semver.valid(this.value); }
function getInstallPackage(version) { let packageToInstall = 'react-scripts'; const validSemver = semver.valid(version); if (validSemver) { packageToInstall += `@${validSemver}`; } else if (version) { // for tar.gz or alternative paths packageToInstall = version; } return packageToInstall; }
function getInstallPackage(version) { let packageToInstall = 'react-scripts'; const validSemver = semver.valid(version); if (validSemver) { packageToInstall += `@${validSemver}`; } else if (version) { // for tar.gz or alternative paths packageToInstall = version; } return packageToInstall; }
/** * Checks that version property matches X.X.X or tries to modify it to match it. In case it is not possible returns 1.0.0 * @param {object} version - Value of oasDoc.info.version. */ function checkVersion(version) { var validVersion = semver.valid(semver.coerce(version)); if (validVersion == null) { return "1.0.0"; } else { return validVersion; } }