Skip to content

Commit c33779a

Browse files
feat: add sort func to diagnostic report
Signed-off-by: Fredrik Nordlander <fredrik.nordlander@digg.se>
1 parent dccd71b commit c33779a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/util/apiUtil.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ export async function processApiSpec(
5050
const customDiagnostic = new RapLPDiagnostic(context);
5151
customDiagnostic.processRuleExecutionInformation(result, enabledRulesAndCategorys.rules,enabledRulesAndCategorys.instanceCategoryMap);
5252
const diagnosticReports: DiagnosticReport[] = customDiagnostic.processDiagnosticInformation();
53-
return { result, report: diagnosticReports };
53+
54+
const sortedReports: DiagnosticReport[] = diagnosticReports.map(report => ({
55+
...report,
56+
regler: [...report.regler].sort((a, b) => a.id.localeCompare(b.id))
57+
}));
58+
return { result, report: sortedReports };
5459
}
5560

5661
/**

0 commit comments

Comments
 (0)