mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-30 12:05:39 -05:00
26 lines
667 B
TypeScript
26 lines
667 B
TypeScript
import {
|
|
type SuperBlocks,
|
|
getAuditedSuperBlocks
|
|
} from '../../shared/config/superblocks';
|
|
|
|
export function isAuditedSuperBlock(
|
|
language: string,
|
|
superblock: SuperBlocks,
|
|
{
|
|
showNewCurriculum,
|
|
showUpcomingChanges
|
|
}: { showNewCurriculum: boolean; showUpcomingChanges: boolean }
|
|
) {
|
|
// 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({
|
|
showNewCurriculum,
|
|
showUpcomingChanges,
|
|
language
|
|
});
|
|
return auditedSuperBlocks.includes(superblock);
|
|
}
|