20 lines
464 B
JavaScript
Raw Normal View History

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