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

Function normalizeDiagnostics

test/development/basic/next-rs-api.test.ts:65–90  ·  view source on GitHub ↗
(diagnostics: Diagnostics[])

Source from the content-addressed store, hash-verified

63}
64
65function normalizeDiagnostics(diagnostics: Diagnostics[]) {
66 return diagnostics
67 .map((diagnostic) => {
68 if (diagnostic.name === 'EVENT_BUILD_FEATURE_USAGE') {
69 diagnostic.payload = Object.fromEntries(
70 Object.entries(diagnostic.payload).map(([key, value]) => {
71 return [
72 key.replace(
73 /^(x86_64|i686|aarch64)-(apple-darwin|unknown-linux-(gnu|musl)|pc-windows-msvc)$/g,
74 'platform-triplet'
75 ),
76 value,
77 ]
78 })
79 )
80 }
81 return diagnostic
82 })
83 .sort((a, b) => {
84 const a_ = JSON.stringify(a)
85 const b_ = JSON.stringify(b)
86 if (a_ < b_) return -1
87 if (a_ > b_) return 1
88 return 0
89 })
90}
91
92function raceIterators<T>(iterators: AsyncIterableIterator<T>[]) {
93 const nexts = iterators.map((iterator, i) =>

Callers 1

Calls 5

replaceMethod · 0.65
sortMethod · 0.45
mapMethod · 0.45
entriesMethod · 0.45
stringifyMethod · 0.45

Tested by

no test coverage detected