github-pages-deploy-action/node_modules/es-abstract/helpers/assign.js

23 lines
451 B
JavaScript
Raw Normal View History

2020-01-28 13:08:03 +08:00
'use strict';
var GetIntrinsic = require('../GetIntrinsic');
var has = require('has');
var $assign = GetIntrinsic('%Object%').assign;
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)) {
2020-03-07 11:45:40 +08:00
// eslint-disable-next-line no-param-reassign
2020-01-28 13:08:03 +08:00
target[key] = source[key];
}
}
return target;
};