source: node_modules/ramda/es/internal/_objectAssign.js@ 65b6638

main
Last change on this file since 65b6638 was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 698 bytes
Line 
1import _has from "./_has.js"; // Based on https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
2
3function _objectAssign(target) {
4 if (target == null) {
5 throw new TypeError('Cannot convert undefined or null to object');
6 }
7
8 var output = Object(target);
9 var idx = 1;
10 var length = arguments.length;
11
12 while (idx < length) {
13 var source = arguments[idx];
14
15 if (source != null) {
16 for (var nextKey in source) {
17 if (_has(nextKey, source)) {
18 output[nextKey] = source[nextKey];
19 }
20 }
21 }
22
23 idx += 1;
24 }
25
26 return output;
27}
28
29export default typeof Object.assign === 'function' ? Object.assign : _objectAssign;
Note: See TracBrowser for help on using the repository browser.