Skip to content

Commit

Permalink
feat: default value for disabled property of audit config
Browse files Browse the repository at this point in the history
  • Loading branch information
iuliag committed Jan 26, 2024
1 parent 77beb5d commit 54db4bb
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@
*/

import AuditConfigType from './audit-config-type.js';
import { AUDIT_TYPE_BROKEN_BACKLINKS } from '../audit.js';

const AUDIT_TYPE_DISABLED_DEFAULTS = {
[AUDIT_TYPE_BROKEN_BACKLINKS]: true,
};

function getAuditTypeConfigs(auditTypeConfigs, auditsDisabled) {
return Object.entries(auditTypeConfigs || {}).reduce((acc, [key, value]) => {
acc[key] = AuditConfigType(value, auditsDisabled);
acc[key] = AuditConfigType(
{
...value,
disabled: AUDIT_TYPE_DISABLED_DEFAULTS[key] || auditsDisabled,
},
);
return acc;
}, {});
}
Expand Down

0 comments on commit 54db4bb

Please sign in to comment.