(dir, ext)
| 8 | |
| 9 | // Function to get all files that match the glob pattern |
| 10 | const findByExtensionSync = (dir, ext) => { |
| 11 | const matchedFiles = []; |
| 12 | |
| 13 | const files = fs.readdirSync(dir); |
| 14 | |
| 15 | for (const file of files) { |
| 16 | const fileExt = path.extname(file); |
| 17 | |
| 18 | if (fileExt === `.${ext}`) { |
| 19 | matchedFiles.push(path.join(dir,file)); |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | return matchedFiles; |
| 24 | }; |
| 25 | |
| 26 | // main function |
| 27 | (async ()=> { |
no test coverage detected
searching dependent graphs…