mirror of
https://github.com/ivuorinen/gh-codeql-report.git
synced 2026-01-26 11:44:01 +00:00
Initial commit
This commit is contained in:
10
src/formatters/json.ts
Normal file
10
src/formatters/json.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user