2021-10-01 08:36:20 +00:00
|
|
|
exports.sortChallengeFiles = function sortChallengeFiles(challengeFiles) {
|
|
|
|
const xs = challengeFiles.slice();
|
2020-06-01 16:28:22 +00:00
|
|
|
xs.sort((a, b) => {
|
2022-01-24 18:42:27 +00:00
|
|
|
if (a.history[0] === 'index.html') return -1;
|
|
|
|
if (b.history[0] === 'index.html') return 1;
|
|
|
|
if (a.history[0] === 'styles.css') return -1;
|
|
|
|
if (b.history[0] === 'styles.css') return 1;
|
|
|
|
if (a.history[0] === 'index.jsx') return -1;
|
|
|
|
if (b.history[0] === 'index.jsx') return 1;
|
|
|
|
if (a.history[0] === 'script.js') return -1;
|
|
|
|
if (b.history[0] === 'script.js') return 1;
|
2020-06-01 16:28:22 +00:00
|
|
|
return 0;
|
|
|
|
});
|
|
|
|
return xs;
|
2020-06-05 16:00:05 +00:00
|
|
|
};
|