24 lines
424 B
JavaScript
24 lines
424 B
JavaScript
var hasKeys = require("./has-keys")
|
|
|
|
module.exports = extend
|
|
|
|
function extend() {
|
|
var target = {}
|
|
|
|
for (var i = 0; i < arguments.length; i++) {
|
|
var source = arguments[i]
|
|
|
|
if (!hasKeys(source)) {
|
|
continue
|
|
}
|
|
|
|
for (var key in source) {
|
|
if (source.hasOwnProperty(key)) {
|
|
target[key] = source[key]
|
|
}
|
|
}
|
|
}
|
|
|
|
return target
|
|
}
|