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
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var GetIntrinsic = require('get-intrinsic');
|
---|
| 4 |
|
---|
| 5 | var hasOwn = require('hasown');
|
---|
| 6 |
|
---|
| 7 | var $assign = GetIntrinsic('%Object.assign%', true);
|
---|
| 8 |
|
---|
| 9 | module.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.