Files
freeCodeCamp/shared/utils/is-audited.ts
2025-09-19 13:28:06 +05:30

14 lines
480 B
TypeScript

import { type SuperBlocks, getAuditedSuperBlocks } from '../config/curriculum';
export function isAuditedSuperBlock(language: string, superblock: SuperBlocks) {
// TODO: when all the consumers of this function use TypeScript we can remove
// this check
if (!language || !superblock)
throw Error('Both arguments must be provided for auditing');
const auditedSuperBlocks = getAuditedSuperBlocks({
language
});
return auditedSuperBlocks.includes(superblock);
}