{"version":3,"file":"FileDiagnosticManager.js","names":[],"sources":["../src/FileDiagnosticManager.ts"],"sourcesContent":["import type { NormalizedDiagnostic } from './logger.js'\n\nclass FileDiagnosticManager {\n public diagnostics: NormalizedDiagnostic[] = []\n\n /**\n * Initialize and reset the diagnostics array\n */\n public initWith(diagnostics: NormalizedDiagnostic[]) {\n this.diagnostics = [...diagnostics]\n }\n\n public getDiagnostics(fileName?: string) {\n if (fileName) {\n return this.diagnostics.filter((f) => f.id === fileName)\n }\n\n return this.diagnostics\n }\n\n public updateByFileId(fileId: string, next: NormalizedDiagnostic[] | null) {\n this.diagnostics = this.diagnostics.filter((d) => d.id !== fileId)\n\n if (next?.length) {\n this.diagnostics.push(...next)\n }\n }\n}\n\nexport { FileDiagnosticManager }\n"],"mappings":";AAEA,IAAM,wBAAN,MAA4B;CAC1B,cAA6C,CAAC;;;;CAK9C,SAAgB,aAAqC;EACnD,KAAK,cAAc,CAAC,GAAG,WAAW;CACpC;CAEA,eAAsB,UAAmB;EACvC,IAAI,UACF,OAAO,KAAK,YAAY,QAAQ,MAAM,EAAE,OAAO,QAAQ;EAGzD,OAAO,KAAK;CACd;CAEA,eAAsB,QAAgB,MAAqC;EACzE,KAAK,cAAc,KAAK,YAAY,QAAQ,MAAM,EAAE,OAAO,MAAM;EAEjE,IAAI,MAAM,QACR,KAAK,YAAY,KAAK,GAAG,IAAI;CAEjC;AACF"}