How to use the check-more-types.semver function in check-more-types

To help you get started, we’ve selected a few check-more-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bahmutov / copi / src / db.js View on Github external
info.candidates.forEach(function (candidatePath) {
    if (!fileExists(candidatePath)) {
      // maybe the folder has been moved or deleted
      return
    }
    const pkg = loadFile(candidatePath)
    if (!is.object(pkg)) {
      console.error('could not read %s', candidatePath)
      return
    }
    if (!is.semver(pkg.version)) {
      console.error('could not read semver from %s got', candidatePath, pkg.version)
      return
    }
    addCandidateInfo(info, candidatePath, pkg.version)
  })
  return info
github cypress-io / cypress / scripts / binary / move-binaries.ts View on Github external
'--commit': String,
    '--version': String,
    // optional, if passed, only the binary for that platform will be moved
    '--platformArch': String,
    // aliases
    '--sha': '--commit',
    '-v': '--version'
  }, {
    argv: args.slice(2)
  })
  debug('moveBinaries with options %o', options)

  // @ts-ignore
  la(is.commitId(options['--commit']), 'missing or invalid commit SHA', options)
  // @ts-ignore
  la(is.semver(options['--version']), 'missing version to collect', options)

  const releaseOptions: ReleaseInformation = {
    commit: options['--commit'],
    version: options['--version']
  }

  const aws = uploadUtils.getS3Credentials()
  const s3 = s3helpers.makeS3(aws)

  // found s3 paths with last build for same commit for all platforms
  const lastBuilds: Desktop[] = []

  let platforms: platformArch[] = uploadUtils.getValidPlatformArchs()
  if (options['--platformArch']) {
    const onlyPlatform = options['--platformArch']
    console.log('only moving single platform %s', onlyPlatform)
github bahmutov / available-versions / src / human-format-spec.js View on Github external
it('does not like tags', function () {
    la(is.semver('0.0.1'), 'plain semver')
    la(!is.semver('0.0.1-beta'), 'semver with tag')
    la(!is.semver('5.0.0-alpha.13'), 'semver with alpha and number')
  })
github bahmutov / available-versions / src / human-format-spec.js View on Github external
it('does not like tags', function () {
    la(is.semver('0.0.1'), 'plain semver')
    la(!is.semver('0.0.1-beta'), 'semver with tag')
    la(!is.semver('5.0.0-alpha.13'), 'semver with alpha and number')
  })
github bahmutov / copi / src / db.js View on Github external
function isLaterVersion (a, b) {
  la(is.semver(a), 'not semver', a)
  la(is.semver(b), 'not semver', b)
  return semver.gt(a, b)
}
github bahmutov / next-ver / bin / next-ver.js View on Github external
function setVersion (newVersion) {
  if (!args.go) {
    debug('skipping "npm version" command, because no --go option set')
    return
  }
  if (!newVersion) {
    debug('skipping "npm version" command, no new version')
    return
  }
  debug(`running "npm version %s" command`, newVersion)
  la(is.semver(newVersion), 'invalid new version', newVersion)

  return npmUtils.incrementVersion({
    increment: newVersion
  })
}
github bahmutov / copi / src / db.js View on Github external
function isLaterVersion (a, b) {
  la(is.semver(a), 'not semver', a)
  la(is.semver(b), 'not semver', b)
  return semver.gt(a, b)
}
github bahmutov / available-versions / src / human-format-spec.js View on Github external
function checkProps (release) {
    la(is.semver(release.version), 'missing version', release)
    la(is.maybe.unemptyString(release.age), 'missing age', release)
    la(is.maybe.unemptyString(release['dist-tag']), 'wrong dist tag', release)
  }