UNPKG

conventional-changelog-ghostwriter

Version:
28 lines (27 loc) 784 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const parser_opts_1 = require("./parser-opts"); exports.default = { parserOpts: parser_opts_1.default, whatBump: (commits) => { let level = 2; let breakings = 0; let features = 0; commits.forEach((commit) => { if (commit.notes.length > 0) { breakings += commit.notes.length; level = 0; } else if (commit.type === 'feat') { features += 1; if (level === 2) { level = 1; } } }); return { level, reason: `Breaking Changes: ${breakings} | Features: ${features}`, }; }, };