core/formatters/canon.formatter.ts

core/formatters/canon.formatter.ts is a file in GovLab Quality. 5 lines of code and 2 definitions.

import { canonRefsFor } from "#configuration/quality/generated/canon.generated";

export const withCanon = function withCanon(text: string, ruleId: string, canonical: readonly string[]): string {
    const canonRef = canonical.length > 0 ? ` [canon: ${canonRefsFor(canonical).join(" ")}]` : "";
    return `${text} [${ruleId}]${canonRef}`;
};