@waron97/prbot 3.1.3 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waron97/prbot",
3
- "version": "3.1.3",
3
+ "version": "3.1.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -196,8 +196,10 @@ function appendRefsToLine(line, tridentIds, jiras) {
196
196
  const suffix = tridentIds.map((id) => `#${id}`).join(', ');
197
197
  const tridentMatch = result.match(/Trident (#[\d, #]+)/);
198
198
  if (tridentMatch) {
199
- const existingTridents = tridentMatch[1].replace(/[,\s]+$/, '');
200
- result = result.replace(/Trident (#[\d, #]+)/, `Trident ${existingTridents}, ${suffix}`);
199
+ const rawCapture = tridentMatch[1];
200
+ const trailing = rawCapture.match(/([,\s]+)$/)?.[1] ?? '';
201
+ const existingTridents = rawCapture.replace(/[,\s]+$/, '');
202
+ result = result.replace(/Trident (#[\d, #]+)/, `Trident ${existingTridents}, ${suffix}${trailing}`);
201
203
  } else {
202
204
  const parenMatch = result.match(/\(([^)]*)\)\s*$/);
203
205
  if (parenMatch) {