MCPcopy Create free account
hub / github.com/TheOdinProject/javascript-exercises / getDirsWithExercises

Function getDirsWithExercises

generators/helpers.js:14–30  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

12}
13
14async function getDirsWithExercises(path) {
15 const ignoredDirs = ["archive", "node_modules", "generators"];
16 try {
17 const dirs = await readdir(join(process.cwd(), path), {
18 withFileTypes: true,
19 });
20 const exerciseDirs = dirs.filter(
21 (entry) =>
22 entry.isDirectory() &&
23 !entry.name.startsWith(".") &&
24 !ignoredDirs.includes(entry.name),
25 );
26 return exerciseDirs.map((dir) => dir.name);
27 } catch {
28 return [];
29 }
30}
31
32async function getLatestExerciseDirectory(path) {
33 try {

Callers 1

getPathForExerciseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected