Skip to content

Commit 6757beb

Browse files
authored
- fix array placeholders are not correctly replaced
1 parent cad1ca5 commit 6757beb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/transform.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export function replaceEmptyTemplate(template: string, options: ReleaseNotesOpti
269269
}
270270
const placeholderMap = new Map<string, string>()
271271
fillAdditionalPlaceholders(options, placeholderMap)
272-
return replacePlaceholders(template, new Map<string, string>(), placeholderMap, placeholders, undefined, options.configuration)
272+
return replacePlaceholders(template, EMPTY_MAP, placeholderMap, placeholders, undefined, options.configuration)
273273
}
274274

275275
function fillAdditionalPlaceholders(
@@ -394,9 +394,9 @@ function fillArrayPlaceholders(
394394
values: string[]
395395
): void {
396396
for (let i = 0; i < values.length; i++) {
397-
placeholderMap.set(`\${{${key}[${i}]}}`, values[i])
397+
placeholderMap.set(`${key}[${i}]`, values[i])
398398
}
399-
placeholderMap.set(`\${{${key}[*]}}`, values.join(', '))
399+
placeholderMap.set(`${key}[*]`, values.join(', '))
400400
}
401401

402402
function fillReviewPlaceholders(
@@ -407,10 +407,10 @@ function fillReviewPlaceholders(
407407
// retrieve the keys from the CommentInfo object
408408
for (const childKey of Object.keys(EMPTY_COMMENT_INFO)) {
409409
for (let i = 0; i < values.length; i++) {
410-
placeholderMap.set(`\${{${parentKey}[${i}].${childKey}}}`, values[i][childKey as keyof CommentInfo]?.toLocaleString('en') || '')
410+
placeholderMap.set(`${parentKey}[${i}].${childKey}`, values[i][childKey as keyof CommentInfo]?.toLocaleString('en') || '')
411411
}
412412
placeholderMap.set(
413-
`\${{${parentKey}[*].${childKey}}}`,
413+
`${parentKey}[*].${childKey}`,
414414
values.map(value => value[childKey as keyof CommentInfo]?.toLocaleString('en') || '').join(', ')
415415
)
416416
}

0 commit comments

Comments
 (0)