const semver = require('semver');

const parser = require('./lib/parser');

const priority = {
    'break': 1,
    'feat': 2,
    'fix': 3,
    '': 4
};

const changeReleaseMap = {
    'break': 'major',
    'feat': 'minor',
    'fix': 'patch',
    '': ''
};

module.exports = function(commits, base) {
    let changeType = commits
        .map((commit) => parser(commit))
        .filter((commit) => !!commit)
        .reduce((type, commit) => {
            if (commit.notes.length) {
                return 'break';
            }
            if (priority[commit.type] <= priority[type]) {
                return commit.type;
            }
            return type;
        }, '');
    let releaseType = changeReleaseMap[changeType];
    return semver.inc(base, releaseType);
};
@@ -119,16 +119,31 @@
 at': 2,%0A
+    'docs': 3,%0A
     'fix
@@ -145,17 +145,17 @@
  'fix': 
-3
+4
 ,%0A    ''
@@ -156,17 +156,17 @@
     '': 
-4
+5
 %0A%7D;%0A%0Acon
@@ -252,16 +252,37 @@
 patch',%0A
+    'docs': 'patch',%0A
     '': 
@@ -327,16 +327,24 @@
 ts, base
+, config
 ) %7B%0A    
@@ -406,16 +406,24 @@
 r(commit
+, config
 ))%0A     
@@ -568,32 +568,33 @@
 ;%0A            %7D%0A
+%0A
             if (

update module parameters