Skip to content

Commit dc39f33

Browse files
committed
refactor: update prepareCommitMsg.ts
1 parent bf82783 commit dc39f33

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/prepareCommitMsg.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export function _cleanJoin(first: string, second: string) {
4343
* every type and we don't have to check if we are part of a word e.g. 'circus'.
4444
*/
4545
function _splitPrefixDesc(value: string) {
46-
return value.includes(":") ? value.split(":") : ["", value];
46+
const [prefix, description] = value.includes(":") ? value.split(":") : ["", value];
47+
48+
return { prefix, description }
4749
}
4850

4951
/**
@@ -59,7 +61,7 @@ function _splitPrefixes(value: string) {
5961
* Separate a message into a Conventional Commit type, if any, and the description.
6062
*/
6163
export function _splitMsg(msg: string) {
62-
const [prefix, description] = _splitPrefixDesc(msg)
64+
const { prefix, description } = _splitPrefixDesc(msg)
6365

6466
const [customPrefix, typePrefix] = _splitPrefixes(prefix)
6567

0 commit comments

Comments
 (0)