You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
451 B
23 lines
451 B
4 years ago
|
'use strict';
|
||
|
|
||
|
var GetIntrinsic = require('../GetIntrinsic');
|
||
|
|
||
|
var has = require('has');
|
||
|
|
||
|
var $assign = GetIntrinsic('%Object%').assign;
|
||
|
|
||
|
module.exports = function assign(target, source) {
|
||
|
if ($assign) {
|
||
|
return $assign(target, source);
|
||
|
}
|
||
|
|
||
|
// eslint-disable-next-line no-restricted-syntax
|
||
|
for (var key in source) {
|
||
|
if (has(source, key)) {
|
||
|
// eslint-disable-next-line no-param-reassign
|
||
|
target[key] = source[key];
|
||
|
}
|
||
|
}
|
||
|
return target;
|
||
|
};
|