mirror of
https://github.com/ivuorinen/gh-codeql-report.git
synced 2026-01-26 03:34:05 +00:00
11 lines
400 B
TypeScript
11 lines
400 B
TypeScript
import type { CodeQLAlert } from '../lib/codeql.js';
|
|
import { type DetailLevel, filterAlertByDetail } from '../lib/types.js';
|
|
|
|
/**
|
|
* Format alerts as JSON
|
|
*/
|
|
export function formatAsJSON(alerts: CodeQLAlert[], detailLevel: DetailLevel = 'medium'): string {
|
|
const filteredAlerts = alerts.map((alert) => filterAlertByDetail(alert, detailLevel));
|
|
return JSON.stringify(filteredAlerts, null, 2);
|
|
}
|