feat(angular.extend) - Simple non-breaking change to support deep extend#10507
feat(angular.extend) - Simple non-breaking change to support deep extend#10507prettycode wants to merge 4 commits into
Conversation
|
CLAs look good, thanks! |
|
Is there a way to rerun the job that failed? It's a timeout, not an explicit (test) failure. |
git commit --amend --date "`date -R`"
git push -f |
|
also, please squash all the commits into one |
There was a problem hiding this comment.
nit: each of these declarations should have its own var for clarity
|
simple question, why is it that |
|
I think I don't see a huge problem with adding this, not to say that there aren't things I dislike about it. |
|
Oh, I should add that |
|
@petebacondarwin what's your opinion? Normally we just tell people to "use lodash", but it's not a very big change, I don't really see the harm in this one |
There was a problem hiding this comment.
If the value is null or undefined, Object.keys() will throw here... Don't worry about checking the type I guess, it's fine
|
I'm afraid I may be in over my head here. Tried to squash the multiple commit (sorry) into one via this, but I'm still seeing multiple commits: git rebase -i HEAD~8 |
|
@prettycode what do you see when you run |
There was a problem hiding this comment.
You misunderstood me in that last commit --- I mean on line 353, the condition should not be if (obj), it should be if (isObject(obj) || isFunction(obj))
|
Thanks for your help, caitp! Sorry for my inexperience with git. Updating tests and the |
|
@caitp - Oh go on then :-) |
There was a problem hiding this comment.
if (isDeep) --argsLength;We don't need to delete anything, it's slow, and deleting the argument doesn't really do anything meaningful (it doesn't change the length value). I said this in like the first 3 comments =)
There was a problem hiding this comment.
If dst[key] is anything other than an object, we really need to replace it with an object --- I think copy() will use an Array if the source is an array, too.
|
Closing in favour of #10519 |
…merges 'deeply' Closes angular#10507 Closes angular#10519
…merges 'deeply' Closes angular#10507 Closes angular#10519
People use
angular.extend()as a utility function, whether or not it's designed for that purpose. It can easily be extended to support recursive merging with very very minor additions. Developers coming to Angular expectextend()to support this.