MCPcopy Create free account
hub / github.com/decaporg/decap-cms / commentsToNotes

Function commentsToNotes

packages/decap-cms-lib-util/src/notesFormat.ts:130–143  ·  view source on GitHub ↗
(
  comments: CommentData[],
  issueUrl: string | undefined,
  toNote: (comment: CommentData) => Note = commentToNote,
)

Source from the content-addressed store, hash-verified

128}
129
130export 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
145export function markOwnNotes(
146 notes: Note[],

Callers 4

checkCurrentIssueMethod · 0.90
getEntryNotesMethod · 0.90
getEntryNotesMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected