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

Update cloudinary.js to copy over options instead of mutating #54

Merged
merged 2 commits into from Jun 28, 2015

Conversation

gching
Copy link
Contributor

@gching gching commented May 19, 2015

Instead of using in the passed in options argument in .image, we use _.extend to make a shallow copy of the options object passed in. Therefore, there will be no way of mutating the options object directly.

This happens in .video too but the options are deep cloned later on. I still used .extend as I do not know if anything before the deep clone mutates options.

Added tests as well :)

Issue: #55

Side note: We are not deep copying so deeper objects could possibly be mutated. Not worrying about this unless objects to get mutated at a deeper level.

Instead of using in the passed in `option` argument in `.image` and `.video`, we first copy it over so there is no way we mutate the passed in option object.
@tocker tocker merged commit 04d86b7 into cloudinary:master Jun 28, 2015
@tocker
Copy link
Contributor

tocker commented Jun 28, 2015

Thanks for catching this!

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.

None yet

2 participants