mirror of https://github.com/iptv-org/iptv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
272 B
TypeScript
14 lines
272 B
TypeScript
1 year ago
|
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)
|
||
|
}
|
||
|
}
|