You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
464 B

  1. const SemVer = require('../classes/semver')
  2. const inc = (version, release, options, identifier, identifierBase) => {
  3. if (typeof (options) === 'string') {
  4. identifierBase = identifier
  5. identifier = options
  6. options = undefined
  7. }
  8. try {
  9. return new SemVer(
  10. version instanceof SemVer ? version.version : version,
  11. options
  12. ).inc(release, identifier, identifierBase).version
  13. } catch (er) {
  14. return null
  15. }
  16. }
  17. module.exports = inc