1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-14 16:00:17 +00:00
musix-oss/node_modules/es-abstract/helpers/assign.js
2020-03-03 22:30:50 +02:00

23 lines
451 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)) {
// eslint-disable-next-line no-param-reassign
target[key] = source[key];
}
}
return target;
};