import { AxeResults } from 'axe-core' ; import { SarifLog } from 'axe-sarif-converter' ; import { inject , injectable } from 'inversify' ; import { ReportFormat } from 'storage-documents' ; import { iocTypeNames } from '../ioc-types' ; import { AxeResultConverter } from './axe-result-converter' ; @ injectable ( ) export class AxeResultToSarifConverter implements AxeResultConverter { public readonly targetReportFormat : ReportFormat = 'sarif' ; constructor ( @ inject ( iocTypeNames . ConvertAxeToSarifFunc ) private readonly convertAxeToSarifFunc ) { } public convert ( results ) { const sarifResults = this . convertAxeToSarifFunc ( results ) ; return JSON . stringify ( sarifResults ) ; } }