Skip to content

Instantly share code, notes, and snippets.

@CaptainLiao
Created January 10, 2018 06:58
Show Gist options
  • Save CaptainLiao/4dcda3658b5528785639b670720057fe to your computer and use it in GitHub Desktop.
Save CaptainLiao/4dcda3658b5528785639b670720057fe to your computer and use it in GitHub Desktop.
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