Opal-Estate-Pro/node_modules/es-abstract/helpers/assign.js

22 lines
402 B
JavaScript
Raw Normal View History

2019-09-13 06:27:52 +02:00
'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;
};