File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 * Require a colon to exist to detect type prefix. i.e. 'ci' will be considered a description, but
1111 * 'ci:' will be considered a prefix. This keeps the check simpler as we don't have to match against
1212 * every type and we don't have to check if we are part of a word e.g. 'circus'.
13- *
14- * If there is no colon to indicate a type prefix, but the message looks like a Jira prefix like
15- * '[ABCD-123]', then use that as a custom prefix.
1613 */
1714export function _splitPrefixDesc ( value : string ) {
1815 let prefix = "" ;
1916 let description = "" ;
2017
2118 if ( value . includes ( ":" ) ) {
2219 [ prefix , description ] = value . split ( ":" , 2 ) ;
23- } else {
20+ }
21+ else {
2422 description = value ;
2523 }
2624
@@ -38,7 +36,10 @@ function _splitPrefixes(value: string) {
3836}
3937
4038/**
41- * Separate a message prefixs if any and the description.
39+ * Separate a message into prefixes if any and the description.
40+ *
41+ * If there is no colon to indicate a type prefix, but the message looks like a Jira prefix like
42+ * '[ABCD-123]', then use that as a custom prefix.
4243 */
4344export function splitMsg ( msg : string ) {
4445 const { prefix, description } = _splitPrefixDesc ( msg ) ;
You can’t perform that action at this time.
0 commit comments