source: imaps-frontend/node_modules/es-abstract/helpers/assign.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 464 bytes
RevLine 
[d565449]1'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var hasOwn = require('hasown');
6
7var $assign = GetIntrinsic('%Object.assign%', true);
8
9module.exports = function assign(target, source) {
10 if ($assign) {
11 return $assign(target, source);
12 }
13
14 // eslint-disable-next-line no-restricted-syntax
15 for (var key in source) {
16 if (hasOwn(source, key)) {
17 // eslint-disable-next-line no-param-reassign
18 target[key] = source[key];
19 }
20 }
21 return target;
22};
Note: See TracBrowser for help on using the repository browser.