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