1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/es-abstract/helpers/assign.js

23 lines
464 B
JavaScript
Raw Normal View History

2023-12-28 23:41:32 +08:00
'use strict';
2023-12-18 13:12:25 +08:00
2023-12-28 23:41:32 +08:00
var GetIntrinsic = require('get-intrinsic');
var hasOwn = require('hasown');
var $assign = GetIntrinsic('%Object.assign%', true);
2023-12-18 13:12:25 +08:00
module.exports = function assign(target, source) {
if ($assign) {
return $assign(target, source);
}
2023-12-28 23:41:32 +08:00
// eslint-disable-next-line no-restricted-syntax
2023-12-18 13:12:25 +08:00
for (var key in source) {
2023-12-28 23:41:32 +08:00
if (hasOwn(source, key)) {
// eslint-disable-next-line no-param-reassign
2023-12-18 13:12:25 +08:00
target[key] = source[key];
}
}
return target;
};