Conversation
When the "origin" object argument is null or not defined, _extend throws exception. Fix _extend to allow undefined "origin" object argument and return the "add" object argument.
|
Should we not be returning a copy of add? (ie: set Imho, we should always return |
Fix _extend to allow undefined "origin" object argument and create a new origin object to return, instead of returning "add" object argument.
|
I totally agree @ronkorving. I've just pushed a fix for this suggested behavior, so the |
|
Thanks! 👍 |
|
Is the use case for this just cloning an object, or am I missing something? |
lib/util.js
Outdated
There was a problem hiding this comment.
I can see that the above condition uses || typeof add !== 'object', but I'd rather not see that added again down below. util._extend(36, {a: 42}) makes no sense.
There was a problem hiding this comment.
I agree with @brendanashworth. util._extend(36, {a: 42}) is nonsensical and should probably blow up.
|
I'm not sure that this is really pressing enough to be added. |
|
-1 on this. Not seeing the benefit (extending a null or undefined should blow up IMO). given the lack of activity, closing. Can reopen if anyone feel it is necessary. |
|
FWIW, we also have |
|
Object.assign is quite slow unfortunately :( |
When the "origin" object argument is null or not defined, _extend
throws exception.
Fix _extend to allow undefined "origin" object argument and return
the "add" object argument.