(dir, ext, opts = {})
| 10 | import walk from 'walk-sync' |
| 11 | |
| 12 | export default function walkFiles(dir, ext, opts = {}) { |
| 13 | const extensions = Array.isArray(ext) ? ext : [ext] |
| 14 | const dirPath = path.posix.join(process.cwd(), dir) |
| 15 | const walkSyncOpts = { includeBasePath: true, directories: false } |
| 16 | |
| 17 | return walk(dirPath, walkSyncOpts) |
| 18 | .filter((file) => extensions.some((ext) => file.endsWith(ext)) && !file.endsWith('README.md')) |
| 19 | .filter((file) => (opts.includeEarlyAccess ? file : !file.includes('/early-access/'))) |
| 20 | } |
no outgoing calls
no test coverage detected