diff options
Diffstat (limited to 'deps/npm/node_modules/es-abstract/helpers/assign.js')
-rw-r--r-- | deps/npm/node_modules/es-abstract/helpers/assign.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/deps/npm/node_modules/es-abstract/helpers/assign.js b/deps/npm/node_modules/es-abstract/helpers/assign.js new file mode 100644 index 0000000000..2533d20a36 --- /dev/null +++ b/deps/npm/node_modules/es-abstract/helpers/assign.js @@ -0,0 +1,17 @@ +var bind = require('function-bind'); +var has = bind.call(Function.call, Object.prototype.hasOwnProperty); + +var $assign = Object.assign; + +module.exports = function assign(target, source) { + if ($assign) { + return $assign(target, source); + } + + for (var key in source) { + if (has(source, key)) { + target[key] = source[key]; + } + } + return target; +}; |