Skip to content

Commit

Permalink
fix: useless regular-expression character escape
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlu-zyl committed Mar 26, 2024
1 parent b3181d8 commit 294bbe8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/changeset/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ const defaultCommitTypes = [
]

export function isBreakingChange(commit: string) {
return commit.includes('BREAKING CHANGE:') || defaultCommitTypes.some((commitType) => commit.match(new RegExp(`^${commitType.type}(?:\(.*\))?!:`)))
return commit.includes('BREAKING CHANGE:') || defaultCommitTypes.some((commitType) => commit.match(new RegExp(`^${commitType.type}(?:(.*))?!:`)))
}

export function isConventionalCommit(commit: string) {
return defaultCommitTypes.some((commitType) => commit.match(new RegExp(`^${commitType.type}(?:\(.*\))?!?:`)))
return defaultCommitTypes.some((commitType) => commit.match(new RegExp(`^${commitType.type}(?:(.*))?!?:`)))
}

/* Attempts to associate non-conventional commits to the nearest conventional commit */
Expand Down

0 comments on commit 294bbe8

Please sign in to comment.