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

Function getLatestExerciseDirectory

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

Source from the content-addressed store, hash-verified

30}
31
32async function getLatestExerciseDirectory(path) {
33 try {
34 const files = await readdir(join(process.cwd(), path));
35 return files.findLast((file) => /^\d+_\w+$/.test(file));
36 } catch {
37 return "0";
38 }
39}
40
41async function createExerciseDirectoryName(exerciseName, path) {
42 const latestExerciseDirectory = await getLatestExerciseDirectory(path);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected