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/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", 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,