(basePath, cb, filter)
| 44 | // walkDir *recursively* walks directories trees, |
| 45 | // calling the callback for all normal files found. |
| 46 | function walkDir(basePath, cb, filter) { |
| 47 | return readdir(basePath) |
| 48 | .then((files) => { |
| 49 | const paths = files.map(filename => path.join(basePath, filename)); |
| 50 | return Promise.all(paths.map(filepath => lstat(filepath) |
| 51 | .then((stats) => { |
| 52 | if (filter !== undefined && !filter(filepath, stats)) return; |
| 53 | |
| 54 | if (stats.isSymbolicLink()) return; |
| 55 | if (stats.isFile()) return cb(filepath); |
| 56 | if (stats.isDirectory()) return walkDir(filepath, cb, filter); |
| 57 | }))); |
| 58 | }); |
| 59 | } |
| 60 | |
| 61 | function makeLibFiles(sourceMaps) { |
| 62 | // NB: we need to make a copy of babelOpts, since babel sets some defaults on it |
no test coverage detected