1
0
mirror of https://github.com/iptv-org/iptv.git synced 2025-06-18 18:23:35 +08:00
iptv/scripts/core/logParser.ts
2023-09-15 18:40:35 +03:00

14 lines
272 B
TypeScript

export type LogItem = {
filepath: string
count: number
}
export class LogParser {
parse(content: string): any[] {
if (!content) return []
const lines = content.split('\n')
return lines.map(line => (line ? JSON.parse(line) : null)).filter(l => l)
}
}