MCPcopy
hub / github.com/vercel/next.js / normalizeIssues

Function normalizeIssues

test/development/basic/next-rs-api.test.ts:44–63  ·  view source on GitHub ↗
(issues: Issue[])

Source from the content-addressed store, hash-verified

42}
43
44function normalizeIssues(issues: Issue[]) {
45 return issues
46 .map((issue) => ({
47 ...issue,
48 detail:
49 issue.detail && normalizePath(styledStringToMarkdown(issue.detail)),
50 filePath: issue.filePath && normalizePath(issue.filePath),
51 source: issue.source && {
52 ...issue.source,
53 source: normalizePath(issue.source.source.ident),
54 },
55 }))
56 .sort((a, b) => {
57 const a_ = JSON.stringify(a)
58 const b_ = JSON.stringify(b)
59 if (a_ < b_) return -1
60 if (a_ > b_) return 1
61 return 0
62 })
63}
64
65function normalizeDiagnostics(diagnostics: Diagnostics[]) {
66 return diagnostics

Callers 1

Calls 5

styledStringToMarkdownFunction · 0.85
normalizePathFunction · 0.70
sortMethod · 0.45
mapMethod · 0.45
stringifyMethod · 0.45

Tested by

no test coverage detected