From 44f8ad160edfd6439b65a7639c5e0bf1021385be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 00:31:41 +0000 Subject: [PATCH 1/2] chore(deps): bump typescript from 5.4.5 to 5.5.3 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.5 to 5.5.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.5...v5.5.3) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index cf10d0e..6a491a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "js-yaml": "^4.1.0", "prettier": "^3.3.2", "ts-jest": "^29.1.5", - "typescript": "^5.4.5" + "typescript": "^5.5.3" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.15.0", @@ -6448,9 +6448,9 @@ } }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index 16fa5b0..3543926 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "js-yaml": "^4.1.0", "prettier": "^3.3.2", "ts-jest": "^29.1.5", - "typescript": "^5.4.5" + "typescript": "^5.5.3" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.15.0", From 9c2725097443c7d33d76e15c08e9e5cd3244c935 Mon Sep 17 00:00:00 2001 From: Ryan Owens Date: Mon, 8 Jul 2024 19:52:53 -0500 Subject: [PATCH 2/2] fix: switch to unicode aware regex for punctuation --- __tests__/index.test.ts | 2 +- src/main.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/__tests__/index.test.ts b/__tests__/index.test.ts index bd3a26e..0b5d903 100644 --- a/__tests__/index.test.ts +++ b/__tests__/index.test.ts @@ -318,7 +318,7 @@ describe("index", () => { const regex = getRegex(); const defaultRegex = // eslint-disable-next-line no-useless-escape - /(?<=^|[a-z]-|[\s\p{Punct}&[^\-]])([A-Z][A-Z0-9_]*-\d+)(?![^\W_])(\s)+(.)+/; + /(?<=^|[a-z]-|[\s\p{P}&[^\-])([A-Z][A-Z0-9_]*-\d+)(?![^\W_])(\s)+(.)+/u; expect(regex.length).toEqual(1); expect(regex[0]).toEqual(defaultRegex); expect(regex[0].test("PR-4 this is valid")).toBe(true); diff --git a/src/main.ts b/src/main.ts index 382ea68..636263c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -94,11 +94,12 @@ export const getPullRequestTitle = () => { const getDefaultJiraIssueRegex = () => new RegExp( - "(?<=^|[a-z]-|[\\s\\p{Punct}&[^\\-]])([A-Z][A-Z0-9_]*-\\d+)(?![^\\W_])(\\s)+(.)+", + "(?<=^|[a-z]-|[\\s\\p{P}&[^\\-])([A-Z][A-Z0-9_]*-\\d+)(?![^\\W_])(\\s)+(.)+", + "u" ); const isValidProjectKey = (projectKey: string) => - /(?<=^|[a-z]-|[\s\p{Punct}&[^-]])([A-Z][A-Z0-9_]*)/.test(projectKey); + /(?<=^|[a-z]-|[\s\p{P}&[^-])([A-Z][A-Z0-9_]*)/u.test(projectKey); const getRegexWithProjectKeyAndKeyAnywhereInTitle = ( projectKey: string,