Closed florianeckerstorfer closed 9 years ago
Sorry for the late response but I'd rather revert this. Whether the path object is returned or not doesn't affect renaming result. This documentaton change would just confuses users.
At least the only way I got renaming by function to work is by adding
return path;
to the function.
@florianeckerstorfer Can you provide an example that can reproduce the problem?
@shinnn I only merged this because I also had this problem before, so I guess we should open a ticket for fixing this then revert the doc change.
I think the return is a better API decision though IMO - otherwise people will try to do async shit in there and it won't work
I think the return is a better API decision though IMO
Previously gulp-rename checked the return value first, and used the original path object as a fallback, but it was removed in https://github.com/hparra/gulp-rename/pull/24.
After checking again I could not reproduce the error, maybe I was on a earlier version, I don't know. I kinda expected the return
, because when I was reading the docs I was wondering "no return?" and thats why I created the PR prematurely. Sorry for that.
Reverted in https://github.com/hparra/gulp-rename/pull/72.
At least the only way I got renaming by function to work is by adding
return path;
to the function.