(
oldComment: string | undefined | null,
newComment: string | undefined | null
)
| 79 | * Returns true if the comments are semantically different (i.e., a real change). |
| 80 | */ |
| 81 | const areCommentsDifferent = ( |
| 82 | oldComment: string | undefined | null, |
| 83 | newComment: string | undefined | null |
| 84 | ): boolean => { |
| 85 | const normalizedOld = normalizeComment(oldComment); |
| 86 | const normalizedNew = normalizeComment(newComment); |
| 87 | |
| 88 | // Both undefined/empty means equal |
| 89 | if (!normalizedOld && !normalizedNew) { |
| 90 | return false; |
| 91 | } |
| 92 | |
| 93 | // One defined, one not means different |
| 94 | if (!normalizedOld || !normalizedNew) { |
| 95 | return true; |
| 96 | } |
| 97 | |
| 98 | // Compare normalized versions |
| 99 | return normalizedOld !== normalizedNew; |
| 100 | }; |
| 101 | |
| 102 | // Helper to determine if an attribute change should add to the changed map |
| 103 | // - undefined: always add (current behavior) |
no test coverage detected