also looking at this
chore(deps): update all non-major dependencies
#2997
29 files
+1047
-444
| @@ -10,10 +10,15 @@ export function formatComments(comments: string[] | undefined, keepComments: boo | ||
| 10 | 10 | return '' |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | const formattedComments = comments.map((comment) => { | |
| 14 | // Ensure proper spacing and formatting | |
| 15 | return comment.trim() | |
| 16 | }).join('\n') | |
| 13 | // Fast path: single comment (most common case) | |
| 14 | if (comments.length === 1) | |
| 15 | return comments[0].trim() + '\n' | |
| 17 | 16 | |
| 18 | return `${formattedComments}\n` | |
| 17 | // Multiple comments: join with newlines | |
| 18 | let result = '' | |
| 19 | for (let i = 0; i < comments.length; i++) { | |
| 20 | if (i > 0) result += '\n' | |
| 21 | result += comments[i].trim() | |
| 22 | } | |
| 23 | return result + '\n' | |
| 19 | 24 | } |