MCPcopy
hub / github.com/vitejs/vite / parseCategories

Function parseCategories

scripts/mergeChangelog.ts:71–95  ·  view source on GitHub ↗
(releaseLines: string[])

Source from the content-addressed store, hash-verified

69}
70
71function parseCategories(releaseLines: string[]): Map<string, string[]> {
72 const categories = new Map<string, string[]>()
73 let currentCategory: string | null = null
74
75 for (let i = 1; i < releaseLines.length; i++) {
76 const line = releaseLines[i]
77 if (versionHeaderRe.test(line)) {
78 currentCategory = null
79 continue
80 }
81 if (line.startsWith('### ')) {
82 currentCategory = line.trim()
83 if (!categories.has(currentCategory)) {
84 categories.set(currentCategory, [])
85 }
86 continue
87 }
88
89 if (currentCategory && line.trim() !== '') {
90 categories.get(currentCategory)!.push(line)
91 }
92 }
93
94 return categories
95}
96
97function findPreviousStableVersion(lines: string[], startIdx: number): string {
98 for (let i = startIdx; i < lines.length; i++) {

Callers 1

mergeChangelog.tsFile · 0.85

Calls 3

hasMethod · 0.80
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected