Repositorio del curso CCOM4030 el semestre B91 del proyecto Paz para la Mujer

assign.js 402B

123456789101112131415161718192021
  1. 'use strict';
  2. var GetIntrinsic = require('../GetIntrinsic');
  3. var has = require('has');
  4. var $assign = GetIntrinsic('%Object%').assign;
  5. module.exports = function assign(target, source) {
  6. if ($assign) {
  7. return $assign(target, source);
  8. }
  9. // eslint-disable-next-line no-restricted-syntax
  10. for (var key in source) {
  11. if (has(source, key)) {
  12. target[key] = source[key];
  13. }
  14. }
  15. return target;
  16. };