Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter parameter fs.copy and fs.copySync #35

Closed
wants to merge 2 commits into from
Closed

filter parameter fs.copy and fs.copySync #35

wants to merge 2 commits into from

Conversation

sri-rang
Copy link
Contributor

Both fs.copy and fs.copySync have a new parameter filter which behaves like a whitelist.

filter can be a function or a regular expression

  • for filter:function, filter(srcPath) must be true for copy
  • for filter:RegExp, filter.test(srcPath) must be true for copy

`filter` can be a function or a regular expression

for filter:function, `filter(src)` must be true for copy
for filter:RegExp, `filter.test(src)` must be true for copy
@sri-rang sri-rang mentioned this pull request Oct 13, 2013
@sri-rang
Copy link
Contributor Author

This changes the interface of fs_extra.copy()

from: fs_extra.copy(src, dest, callback)

to: fs_extra.copy(src, dest, filter, callback)

This probably could be avoidable :-/

@jprichardson
Copy link
Owner

Ya, filter should be optional... but that's not too hard of a modification.

@sri-rang
Copy link
Contributor Author

Yeah, I'll close this pull request, make filter optional, squash commits and send you another PR. ;-)

@sri-rang sri-rang closed this Oct 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants