(defaults: CommitMessageParts)
| 20 | * Generate a commit message builder function, using the provided defaults. |
| 21 | */ |
| 22 | export function commitMessageBuilder(defaults: CommitMessageParts) { |
| 23 | return (params: Partial<CommitMessageParts> = {}) => { |
| 24 | const {prefix, type, scope, summary, body, footer} = {...defaults, ...params}; |
| 25 | return `${prefix}${type}${scope ? '(' + scope + ')' : ''}: ${summary}\n\n${body}\n\n${footer}`; |
| 26 | }; |
| 27 | } |
no outgoing calls
no test coverage detected