(raw, index)
| 194 | } |
| 195 | |
| 196 | function 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 | |
| 216 | function getOrCreateBoard(boardId) { |
| 217 | if (!storage.boards[boardId]) { |
no test coverage detected