thedesk/app/node_modules/es-abstract/helpers/assign.js

18 lines
351 B
JavaScript
Raw Normal View History

2019-09-13 00:38:13 +10:00
var bind = require('function-bind');
var has = bind.call(Function.call, Object.prototype.hasOwnProperty);
var $assign = Object.assign;
module.exports = function assign(target, source) {
if ($assign) {
return $assign(target, source);
}
for (var key in source) {
if (has(source, key)) {
target[key] = source[key];
}
}
return target;
};