From 294bbe8f876041ddbd74468bb405d066c4097c3c Mon Sep 17 00:00:00 2001 From: Alan Lu Date: Wed, 27 Mar 2024 04:36:58 +0800 Subject: [PATCH] fix: useless regular-expression character escape --- packages/changeset/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/changeset/src/index.ts b/packages/changeset/src/index.ts index 7a80259..79e9cab 100644 --- a/packages/changeset/src/index.ts +++ b/packages/changeset/src/index.ts @@ -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 */