mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
23 lines
449 B
JavaScript
23 lines
449 B
JavaScript
|
'use strict';
|
||
|
|
||
|
var GetIntrinsic = require('get-intrinsic');
|
||
|
|
||
|
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;
|
||
|
};
|