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

fix #187 #70 options.filter bug #218

Closed
wants to merge 1 commit into from
Closed

fix #187 #70 options.filter bug #218

wants to merge 1 commit into from

Conversation

eos3tion
Copy link

#187 #70

Files only filter each file while ever returns true, if the first file on the folder or the folder name dont pass the filter, the copy stops.

#187 #70
Files only filter each file while ever returns true, if the first file on the folder or the folder name dont pass the filter, the copy stops.
@jprichardson
Copy link
Owner

#216 (comment)

Would you be able to add a test? Thank you :)

@eos3tion
Copy link
Author

eos3tion commented Feb 3, 2016

var filter=/.*[.]json/ig;
var samples=["c:/11/22/33/aaa.json","c:/11/22/33/b.json","c:/11/22/33/abcdefg.json"];
samples.forEach( (item, index, array)=>console.log(filter.test(item)));

true
false
true

set filter's lastIndex to 0:

var filter=/.*[.]json/ig;
var samples=["c:/11/22/33/aaa.json","c:/11/22/33/b.json","c:/11/22/33/abcdefg.json"];
samples.forEach( (item, index, array)=>{
     filter.lastIndex=0;
     console.log(filter.test(item))
});

true
true
true

@RyanZim
Copy link
Collaborator

RyanZim commented Dec 29, 2016

@jprichardson regex filters are deprecated and aren't even tested anymore. Should we merge this without tests or just close it?

@jprichardson
Copy link
Owner

jprichardson commented Dec 29, 2016

@jprichardson regex filters are deprecated and aren't even tested anymore. Should we merge this without tests or just close it?

Indeed, thanks for checking.

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.

3 participants