* Convert all examples within a single directory and nested directories. * * @param {*} directoryPath full path to a directory to convert examples from.
(directoryPath)
| 37 | * @param {*} directoryPath full path to a directory to convert examples from. |
| 38 | */ |
| 39 | async function convertExampleDir(directoryPath) { |
| 40 | let examplesFiles = await fs.promises.readdir(directoryPath); |
| 41 | examplesFiles = examplesFiles.map((file) => path.resolve(directoryPath, file)); |
| 42 | const nestedDirectory = examplesFiles.filter((file) => fs.lstatSync(file).isDirectory()); |
| 43 | for (const dir of nestedDirectory) { |
| 44 | await convertExampleDir(dir); |
| 45 | } |
| 46 | |
| 47 | // only convert .yml files |
| 48 | examplesFiles = examplesFiles.filter((file) => path.extname(file) === '.yml' || path.extname(file) === '.yaml'); |
| 49 | examplesFiles.forEach(convertExample); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * |
no outgoing calls
no test coverage detected
searching dependent graphs…