Created
January 10, 2018 06:58
-
-
Save CaptainLiao/4dcda3658b5528785639b670720057fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(target) { | |
for (let i = 1, j = arguments.length; i < j; i++) { | |
let source = arguments[i] || {}; | |
for (let prop in source) { | |
if (source.hasOwnProperty(prop)) { | |
let value = source[prop]; | |
if (value !== undefined) { | |
target[prop] = value; | |
} | |
} | |
} | |
} | |
return target; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment