feat: restrict translation to audited certs

This commit is contained in:
Oliver Eyton-Williams
2020-02-25 10:20:14 +01:00
committed by Mrugesh Mohapatra
parent 1ec6cf1efd
commit b197f73881
2 changed files with 26 additions and 3 deletions

15
utils/is-audited.js Normal file
View File

@ -0,0 +1,15 @@
// this can go once all certs have been audited.
function isAuditedCert(lang, cert) {
if (!lang || !cert)
throw Error('Both arguments must be provided for auditing');
// in order to see the challenges in the client, add the certification that
// contains those challenges to this array:
const auditedCerts = [
'responsive-web-design',
'javascript-algorithms-and-data-structures',
'certificates'
];
return lang === 'english' || auditedCerts.includes(cert);
}
exports.isAuditedCert = isAuditedCert;