Skip to main content

Practice ยท 1 of 3

Commit Message Parser

CHALLENGE
Difficulty: intermediate+25 XP

Write parseCommit(msg) for conventional commits <type>(<scope>)?: <desc>. Return { type, scope, breaking, desc } โ€” scope null when absent, breaking true when ! precedes the colon or a BREAKING CHANGE footer exists (msg contains "BREAKING CHANGE"). Return null for malformed messages (no valid type, no colon, empty desc).

Back to lesson: Practice: Review & Conventional Commits โ€” Practice