Files
pjax/lib/util/extend.js

22 lines
443 B
JavaScript
Raw Normal View History

module.exports = function(target) {
if (target == null) {
2019-03-03 01:37:45 -05:00
return null;
}
2019-03-03 01:37:45 -05:00
var to = Object(target);
for (var i = 1; i < arguments.length; i++) {
2019-03-03 01:37:45 -05:00
var source = arguments[i];
if (source != null) {
for (var key in source) {
// Avoid bugs when hasOwnProperty is shadowed
if (Object.prototype.hasOwnProperty.call(source, key)) {
2019-03-03 01:37:45 -05:00
to[key] = source[key];
}
}
}
}
2019-03-03 01:37:45 -05:00
return to;
};