mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
20 lines
516 B
TypeScript
20 lines
516 B
TypeScript
import { readFileSync } from 'fs';
|
|
import { load } from 'js-yaml';
|
|
import { type Certification } from '@freecodecamp/shared/config/certification-settings';
|
|
|
|
interface CertificationChallenge {
|
|
id: string;
|
|
title: string;
|
|
certification: Certification;
|
|
challengeType: number;
|
|
tests: { id: string; title: string }[];
|
|
}
|
|
|
|
export const buildCertification = (
|
|
filePath: string
|
|
): {
|
|
challenges: CertificationChallenge[];
|
|
} => ({
|
|
challenges: [load(readFileSync(filePath, 'utf8')) as CertificationChallenge]
|
|
});
|