Skip to content

Commit 8d4cf2c

Browse files
committed
refactor: update parseExisting.ts
1 parent 7ee0b7e commit 8d4cf2c

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/generate/parseExisting.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@
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'.
1313
*
14-
* TODO: also support Jira number e.g. '[ABCD-123]', '[ABCD-123] my description', and '[ABCD-123]
15-
* docs: my description'.
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.
1616
*/
17-
function _splitPrefixDesc(value: string) {
18-
let prefix: string, description: string;
17+
export function _splitPrefixDesc(value: string) {
18+
let prefix = ''
19+
let description = ''
1920

2021
if (value.includes(":")) {
2122
[prefix, description] = value.split(":", 2);
22-
} else {
23-
[prefix, description] = ["", value];
23+
}
24+
else {
25+
description = value;
2426
}
2527

2628
return { prefix, description };

0 commit comments

Comments
 (0)