feat: simplify client logic (#46870)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Ilenia
2022-07-14 10:41:20 +02:00
committed by GitHub
parent 709018571b
commit 0a2d0733a2
5 changed files with 26 additions and 26 deletions
+8 -1
View File
@@ -41,18 +41,25 @@ exports.challengeTypes = {
multifileCertProject
};
exports.isProject = challengeType => {
exports.isFinalProject = challengeType => {
if (typeof challengeType !== 'number')
throw Error('challengeType must be a number');
return (
challengeType === frontEndProject ||
challengeType === backEndProject ||
challengeType === jsProject ||
challengeType === pythonProject ||
challengeType === codeAllyCert ||
challengeType === multifileCertProject
);
};
exports.isCodeAllyPractice = challengeType => {
if (typeof challengeType !== 'number')
throw Error('challengeType must be a number');
return challengeType === codeAllyPractice;
};
// turn challengeType to file ext
exports.pathsMap = {
[html]: 'html',