File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,18 +52,19 @@ function _splitPrefixDesc(value: string) {
5252 * Split a prefix into a custom prefix and Conventional Commit type prefix.
5353 */
5454function _splitPrefixes ( value : string ) {
55- return value . includes ( " " )
55+ const [ customPrefix , typePrefix ] = value . includes ( " " )
5656 ? value . split ( " " , 2 )
5757 : [ "" , value ] ;
58+
59+ return { customPrefix, typePrefix }
5860}
5961
6062/**
6163 * Separate a message into a Conventional Commit type, if any, and the description.
6264 */
6365export function _splitMsg ( msg : string ) {
6466 const { prefix, description } = _splitPrefixDesc ( msg )
65-
66- const [ customPrefix , typePrefix ] = _splitPrefixes ( prefix )
67+ const { customPrefix, typePrefix } = _splitPrefixes ( prefix )
6768
6869 return { customPrefix, typePrefix, description : description . trim ( ) } ;
6970}
You can’t perform that action at this time.
0 commit comments