Skip to content

Commit 1720421

Browse files
authored
Merge branch 'canary' into add-example
2 parents 271b3ef + bbf6dfa commit 1720421

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

packages/next/src/server/dev/turbopack-utils.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,6 @@ export async function getTurbopackJsConfig(
4141

4242
class ModuleBuildError extends Error {}
4343

44-
function getIssueKey(issue: Issue): string {
45-
return [
46-
issue.severity,
47-
issue.filePath,
48-
JSON.stringify(issue.title),
49-
JSON.stringify(issue.description),
50-
].join('-')
51-
}
52-
5344
export function formatIssue(issue: Issue) {
5445
const { filePath, title, description, source } = issue
5546
let { documentationLink } = issue
@@ -124,15 +115,23 @@ export function formatIssue(issue: Issue) {
124115
return message
125116
}
126117

127-
export type EntryIssuesMap = Map<EntryKey, Map<string, Issue>>
118+
type IssueKey = `${Issue['severity']}-${Issue['filePath']}-${string}-${string}`
119+
type IssuesMap = Map<IssueKey, Issue>
120+
export type EntryIssuesMap = Map<EntryKey, IssuesMap>
121+
122+
function getIssueKey(issue: Issue): IssueKey {
123+
return `${issue.severity}-${issue.filePath}-${JSON.stringify(
124+
issue.title
125+
)}-${JSON.stringify(issue.description)}`
126+
}
128127

129128
export function processIssues(
130129
currentEntryIssues: EntryIssuesMap,
131130
key: EntryKey,
132131
result: TurbopackResult,
133132
throwIssue = false
134133
) {
135-
const newIssues = new Map<string, Issue>()
134+
const newIssues = new Map<IssueKey, Issue>()
136135
currentEntryIssues.set(key, newIssues)
137136

138137
const relevantIssues = new Set()

0 commit comments

Comments
 (0)