19 lines
400 B
JavaScript
Raw Normal View History

2023-07-24 11:13:08 +08:00
const SemVer = require('../classes/semver')
2023-07-27 15:04:13 +08:00
const inc = (version, release, options, identifier) => {
2023-07-24 11:13:08 +08:00
if (typeof (options) === 'string') {
identifier = options
options = undefined
}
try {
return new SemVer(
version instanceof SemVer ? version.version : version,
options
2023-07-27 15:04:13 +08:00
).inc(release, identifier).version
2023-07-24 11:13:08 +08:00
} catch (er) {
return null
}
}
module.exports = inc