mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-12 10:00:05 -04:00
14 lines
291 B
TypeScript
14 lines
291 B
TypeScript
export type LogItem = {
|
|
type: string
|
|
filepath: string
|
|
count: number
|
|
}
|
|
|
|
export class LogParser {
|
|
parse(content: string): LogItem[] {
|
|
if (!content) return []
|
|
const lines = content.split('\n')
|
|
|
|
return lines.map(line => (line ? JSON.parse(line) : null)).filter(l => l)
|
|
}
|
|
}
|