Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit 9301852

Browse files
author
Charlike Mike Reagent
authored
fix: case sensitivity (#52)
* fix: case insensitive header regex * fix: case insensitivity for the `increment` plugin Updates for the zeke/semantic-pull-requests#39 and conventional-commits/conventionalcommits.org#110 Signed-off-by: Charlike Mike Reagent <[email protected]>
1 parent e07af5d commit 9301852

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/header.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function parseHeader(header) {
3737

3838
// because the last question mark, which we totally need
3939
// eslint-disable-next-line unicorn/no-unsafe-regex
40-
const regex = /^(\w+)(?:\((.+)\))?: (.+)$/;
40+
const regex = /^(\w+)(?:\((.+)\))?: (.+)$/i;
4141
if (!regex.test(header)) {
4242
throw new TypeError(errorMsg);
4343
}

src/plugins/increment.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ export default function increment(commit) {
1414
let isBreaking = isBreakingChange(commit);
1515
let commitIncrement = false;
1616

17-
if (/fix|bugfix|patch/.test(commit.header.type)) {
17+
if (/fix|bugfix|patch/i.test(commit.header.type)) {
1818
commitIncrement = 'patch';
1919
}
20-
if (/feat|feature|minor/.test(commit.header.type)) {
20+
if (/feat|feature|minor/i.test(commit.header.type)) {
2121
commitIncrement = 'minor';
2222
}
23-
if (/break|breaking|major/.test(commit.header.type) || isBreaking) {
23+
if (/break|breaking|major/i.test(commit.header.type) || isBreaking) {
2424
commitIncrement = 'major';
2525
}
2626
isBreaking = isBreaking || commitIncrement === 'major';

0 commit comments

Comments
 (0)