21 lines
328 B
JavaScript
21 lines
328 B
JavaScript
'use strict'
|
|
|
|
module.exports = function (commits) {
|
|
var type = null
|
|
|
|
commits.every(function (commit) {
|
|
if (commit.breaks.length) {
|
|
type = 'major'
|
|
return false
|
|
}
|
|
|
|
if (commit.type === 'feat') type = 'minor'
|
|
|
|
if (!type && commit.type === 'fix') type = 'patch'
|
|
|
|
return true
|
|
})
|
|
|
|
return type
|
|
}
|