PIbd-22.-Stroev-V.M.-Intern.../Lab2/node_modules/es-abstract/helpers/assign.js
2023-10-28 00:49:09 +03:00

23 lines
455 B
JavaScript

'use strict';
var GetIntrinsic = require('get-intrinsic');
var has = require('has');
var $assign = GetIntrinsic('%Object.assign%', true);
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;
};