(title)
| 2 | /^(?<type>feat|fix|perf|revert|docs|chore|refactor|test|build|ci|style)(?:\([^)\r\n]+\))?(?<breaking>!)?: (?<description>\S.*)$/; |
| 3 | |
| 4 | export function validateConventionalTitle(title) { |
| 5 | const match = conventionalTitle.exec(title); |
| 6 | if (!match?.groups) throw new Error('Title is not a supported Conventional Commit.'); |
| 7 | return { |
| 8 | breaking: match.groups.breaking === '!', |
| 9 | description: match.groups.description, |
| 10 | type: match.groups.type, |
| 11 | }; |
| 12 | } |
no outgoing calls
no test coverage detected