mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-19 21:09:51 +08:00
Some checks failed
Docker -- GHCR - Gitpod / build-and-push-image (gitpod) (push) Has been cancelled
i18n - Build Validation / Validate i18n Builds (20.x) (push) Has been cancelled
CI - Node.js / Lint (20.x) (push) Has been cancelled
i18n - Upload Client UI / Client (push) Has been cancelled
i18n - Upload Curriculum / Learn (push) Has been cancelled
CI - Node.js / Build (20.x) (push) Has been cancelled
CI - Node.js / Test (20.x) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (20.x) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 20.x) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 20.x) (push) Has been cancelled
18 lines
657 B
JavaScript
18 lines
657 B
JavaScript
exports.sortChallengeFiles = function sortChallengeFiles(challengeFiles) {
|
|
const xs = challengeFiles.slice();
|
|
xs.sort((a, b) => {
|
|
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;
|
|
if (a.history[0] === 'index.ts') return -1;
|
|
if (b.history[0] === 'index.ts') return 1;
|
|
return 0;
|
|
});
|
|
return xs;
|
|
};
|