{"version":3,"file":"report-diagnostics.mjs","sources":["../../src/utils/report-diagnostics.ts"],"sourcesContent":["import * as ts from 'typescript';\n\nimport { formatHost } from './format-host';\n\n/**\n * Report one or several diagnostic to the console\n */\nexport const reportDiagnostics = (diagnostics: readonly ts.Diagnostic[] | ts.Diagnostic): void => {\n  const formattedDiagnostics = ts.formatDiagnosticsWithColorAndContext(\n    Array.isArray(diagnostics) ? diagnostics : [diagnostics],\n    formatHost\n  );\n\n  console.error(formattedDiagnostics);\n  console.info(`Found ${(diagnostics as ts.Diagnostic[]).length} error(s).${ts.sys.newLine}`);\n};\n"],"names":["reportDiagnostics","diagnostics","formattedDiagnostics","ts","formatDiagnosticsWithColorAndContext","Array","isArray","formatHost","console","error","info","length","sys","newLine"],"mappings":";;;AAIA;;IAGO,MAAMA,iBAAAA,GAAoB,CAACC,WAAAA,GAAAA;IAChC,MAAMC,oBAAAA,GAAuBC,GAAGC,oCAAoC,CAClEC,MAAMC,OAAO,CAACL,eAAeA,WAAAA,GAAc;AAACA,QAAAA;KAAY,EACxDM,UAAAA,CAAAA;AAGFC,IAAAA,OAAAA,CAAQC,KAAK,CAACP,oBAAAA,CAAAA;AACdM,IAAAA,OAAAA,CAAQE,IAAI,CAAC,CAAC,MAAM,EAAE,WAACT,CAAgCU,MAAM,CAAC,UAAU,EAAER,EAAAA,CAAGS,GAAG,CAACC,OAAO,CAAA,CAAE,CAAA;AAC5F;;;;"}