{"version":3,"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,MAAM,sBAAsB;AAAA,EACnB,cAAsC,CAAC;AAAA;AAAA;AAAA;AAAA,EAKvC,SAAS,aAAqC;AACnD,SAAK,cAAc,CAAC,GAAG,WAAW;AAAA,EACpC;AAAA,EAEO,eAAe,UAAmB;AACvC,QAAI,UAAU;AACZ,aAAO,KAAK,YAAY,OAAO,CAAC,MAAM,EAAE,OAAO,QAAQ;AAAA,IACzD;AAEA,WAAO,KAAK;AAAA,EACd;AAAA,EAEO,eAAe,QAAgB,MAAqC;AACzE,SAAK,cAAc,KAAK,YAAY,OAAO,CAAC,MAAM,EAAE,OAAO,MAAM;AAEjE,QAAI,6BAAM,QAAQ;AAChB,WAAK,YAAY,KAAK,GAAG,IAAI;AAAA,IAC/B;AAAA,EACF;AACF;","names":[]}