MCPcopy
hub / github.com/github/awesome-copilot / normalizeItem

Function normalizeItem

extensions/backlog-swipe-triage/extension.mjs:196–214  ·  view source on GitHub ↗
(raw, index)

Source from the content-addressed store, hash-verified

194}
195
196function normalizeItem(raw, index) {
197 const idFromInput = normalizeText(raw?.id);
198 const title = normalizeText(raw?.title, `Item ${index + 1}`);
199 const id = idFromInput || title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "") || `item-${index + 1}`;
200 return {
201 id,
202 title,
203 description: normalizeText(raw?.description),
204 details: normalizeText(raw?.details),
205 repo: normalizeText(raw?.repo),
206 number: normalizeText(raw?.number),
207 url: normalizeText(raw?.url),
208 labels: normalizeStringArray(raw?.labels),
209 assignees: normalizeStringArray(raw?.assignees),
210 createdAt: normalizeText(raw?.createdAt),
211 updatedAt: normalizeText(raw?.updatedAt),
212 author: normalizeText(raw?.author),
213 };
214}
215
216function getOrCreateBoard(boardId) {
217 if (!storage.boards[boardId]) {

Callers 1

setBoardItemsFunction · 0.85

Calls 2

normalizeStringArrayFunction · 0.85
normalizeTextFunction · 0.70

Tested by

no test coverage detected