( comments: CommentData[], issueUrl: string | undefined, toNote: (comment: CommentData) => Note = commentToNote, )
| 128 | } |
| 129 | |
| 130 | export function commentsToNotes( |
| 131 | comments: CommentData[], |
| 132 | issueUrl: string | undefined, |
| 133 | toNote: (comment: CommentData) => Note = commentToNote, |
| 134 | ): Note[] { |
| 135 | return comments.reduce<Note[]>((notes, comment) => { |
| 136 | try { |
| 137 | notes.push({ ...toNote(comment), issueUrl }); |
| 138 | } catch (error) { |
| 139 | // Not a note; skip it |
| 140 | } |
| 141 | return notes; |
| 142 | }, []); |
| 143 | } |
| 144 | |
| 145 | export function markOwnNotes( |
| 146 | notes: Note[], |
no outgoing calls
no test coverage detected