2023-09-15 18:40:35 +03:00
|
|
|
export type LogItem = {
|
2025-03-29 11:39:46 +03:00
|
|
|
type: string
|
2023-09-15 18:40:35 +03:00
|
|
|
filepath: string
|
|
|
|
|
count: number
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class LogParser {
|
2023-09-22 06:22:47 +03:00
|
|
|
parse(content: string): LogItem[] {
|
2023-09-15 18:40:35 +03:00
|
|
|
if (!content) return []
|
|
|
|
|
const lines = content.split('\n')
|
|
|
|
|
|
|
|
|
|
return lines.map(line => (line ? JSON.parse(line) : null)).filter(l => l)
|
|
|
|
|
}
|
|
|
|
|
}
|