Closed evanre closed 4 years ago
@evanre I agree that making the object immutable would be a better API, but I think supporting both cases would make the most sense. If an object is returned, use that - otherwise use the object passed in. This is mainly to make things easier for people who aren't using ES7 for their gulpfiles and still using node supported syntax where cloning can be really annoying via Object.assign.
If you want to send a PR that would be helpful - otherwise I might get around to it in the coming weeks.
Hi, I'm trying to rename files using the change-case module. But the eslint shows me an error
no-param-reassign
. Isn't it better to return the object instead of reassigning its properties? Replace this:to this:
or even this: