diff options
Diffstat (limited to 'src/node_modules/es-abstract/helpers/assign.js')
-rw-r--r-- | src/node_modules/es-abstract/helpers/assign.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/node_modules/es-abstract/helpers/assign.js b/src/node_modules/es-abstract/helpers/assign.js new file mode 100644 index 0000000..7e6666e --- /dev/null +++ b/src/node_modules/es-abstract/helpers/assign.js @@ -0,0 +1,22 @@ +'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)) { + // eslint-disable-next-line no-param-reassign + target[key] = source[key]; + } + } + return target; +}; |