| 8 | |
| 9 | /** @param {string} relativePath */ |
| 10 | const getFilesInFolder = async (relativePath) => { |
| 11 | const folderPath = fileURLToPath(new URL(relativePath, import.meta.url)); |
| 12 | const folderFiles = await readdir(folderPath); |
| 13 | |
| 14 | const fileReads = folderFiles |
| 15 | .map((name) => [name, path.resolve(folderPath, name)]) |
| 16 | .map(async ([name, path]) => ({ |
| 17 | name, |
| 18 | content: await readFile(path, "utf-8"), |
| 19 | })); |
| 20 | |
| 21 | return Promise.all(fileReads); |
| 22 | }; |
| 23 | |
| 24 | /** @returns {Promise<Map<string, { exercise: string, patch?: string }>>} */ |
| 25 | const getPatchMap = async () => { |