File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,10 +35,20 @@ export function _cleanJoin(first: string, second: string) {
3535 return `${ first } ${ second } ` . trim ( ) ;
3636}
3737
38+ /*
39+ * Split message into prefix and description.
40+ *
41+ * Require a colon to exist to detect type prefix. i.e. 'ci' will be considered a description, but
42+ * 'ci:' will be considered a prefix. This keeps the check simpler as we don't have to match against
43+ * every type and we don't have to check if we are part of a word e.g. 'circus'.
44+ */
3845function _splitPrefixDesc ( value : string ) {
3946 return value . includes ( ":" ) ? value . split ( ":" ) : [ "" , value ] ;
4047}
4148
49+ /**
50+ * Split a prefix into a custom prefix and Conventional Commit type prefix.
51+ */
4252function _splitPrefixes ( value : string ) {
4353 return value . includes ( " " )
4454 ? value . split ( " " , 2 )
@@ -47,10 +57,6 @@ function _splitPrefixes(value: string) {
4757
4858/**
4959 * Separate a message into a Conventional Commit type, if any, and the description.
50- *
51- * Require a colon to exist to detect type prefix. i.e. 'ci' will be considered a description, but
52- * 'ci:' will be considered a prefix. This keeps the check simpler as we don't have to match against
53- * every type and we don't have to check if we are part of a word e.g. 'circus'.
5460 */
5561export function _splitMsg ( msg : string ) {
5662 const [ prefix , description ] = _splitPrefixDesc ( msg )
You can’t perform that action at this time.
0 commit comments