mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 12:21:07 +07:00
22 lines
402 B
JavaScript
22 lines
402 B
JavaScript
|
'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)) {
|
||
|
target[key] = source[key];
|
||
|
}
|
||
|
}
|
||
|
return target;
|
||
|
};
|