Skip to content

[Feature Request] [copy] pass srcStat and destStat to filter #844

@jedwards1211

Description

@jedwards1211

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')

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions