-
Notifications
You must be signed in to change notification settings - Fork 87
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
When replacestream is used replace function is passed array of matches #30
Comments
Maybe this is something i should change with replacestream. I think it is easier if everything is consistent with String.replace |
Hmm, I agree we should definitely be consistent between a regex match on a stream and on a buffer. @mehtaphysical @eugeneware, what do you think? |
I'm willing to make that change. I wonder what @eugeneware thinks. I created an issue eugeneware/replacestream#15 |
It's ok by me. Consistency and ease of use should trump compatibility. 👍 |
@eugeneware @mehtaphysical any timeline on getting this made consistent? I'm thinking a temporary workaround as suggested by @nlundquist is in order until it's changed in |
@lazd it's a pretty easy change. I'll write it this weekend and let @eugeneware review it. |
Sounds great, thanks! |
Sounds like a plan! :-) |
@lazd done :) |
Released as |
As per the replacestream docs (https://github.com/eugeneware/replacestream) the replacement function is passed an array of matches rather than being called with the matches as parameters, the behaviour of String.replace.
Gulp-replace implies in its documentation that the String.replace behaviour should be expected despite this being false when replacestream is used. This can't be expected by the user. When using replacestream gulp-replace should wrap the replacement function so that the array is converted into parameters for the wrapped function.
The text was updated successfully, but these errors were encountered: