-
Notifications
You must be signed in to change notification settings - Fork 454
fix(deepExtend): Ensure dest is obj when src is obj #369
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
Conversation
|
We need a unit test on this IMO |
|
Tests added for this case, but for a method such as |
|
Is there a reason we're not using angular.merge? |
|
idk, I didn't make this thing, just trying to fix it. You can probably create a PR for replacing |
|
@TheSharpieOne Good idea about the PR. In the meantime I think your fix is good for now. I'm locked at 0.0.8 until I can trust this lib to not break me with a semver patch-version number update. |
fix(deepExtend): Ensure dest is obj when src is obj
|
Thanks @TheSharpieOne and @brandonrobertz. |
|
angular.merge did not exist when this package was written and only exists in angular 1.4 onwards... Probably not worth breaking compatibility with lower versions for this one method. |
currently
deepExtendis not ensuring thedestinationis an object when the source is an object.deepExtendcurrently does a similar check/set for the case ofsourcebeing an array.This PR adds the check for
destinationbeing an object and if not sets it to{}.