I'm willing to make a PR if you're on board with this 🙂
As mentioned in #843, when doing a copy, filter is actually called with both files and directories. This means if we only want to copy .js files, our filter has to be filter: async f => (await fs.stat(f)).isDirectory() || f.endsWith('.js'), which is cumbersome and redundant.
copy is already getting the stats of everything along the way, so if it would pass them to the filter then we could avoid getting them redundantly: filter: (src, dest, srcStat, destStat) => srcStat.isDirectory() || src.endsWith('.js')
I'm willing to make a PR if you're on board with this 🙂
As mentioned in #843, when doing a
copy,filteris actually called with both files and directories. This means if we only want to copy.jsfiles, our filter has to befilter: async f => (await fs.stat(f)).isDirectory() || f.endsWith('.js'), which is cumbersome and redundant.copyis already getting the stats of everything along the way, so if it would pass them to the filter then we could avoid getting them redundantly:filter: (src, dest, srcStat, destStat) => srcStat.isDirectory() || src.endsWith('.js')