source: node_modules/ramda/src/internal/_objectAssign.js

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

Initial commit

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