assign.js 677 B

1234567891011121314151617181920212223242526
  1. "use strict";
  2. var root_1 = require('./root');
  3. function assignImpl(target) {
  4. var sources = [];
  5. for (var _i = 1; _i < arguments.length; _i++) {
  6. sources[_i - 1] = arguments[_i];
  7. }
  8. var len = sources.length;
  9. for (var i = 0; i < len; i++) {
  10. var source = sources[i];
  11. for (var k in source) {
  12. if (source.hasOwnProperty(k)) {
  13. target[k] = source[k];
  14. }
  15. }
  16. }
  17. return target;
  18. }
  19. exports.assignImpl = assignImpl;
  20. ;
  21. function getAssign(root) {
  22. return root.Object.assign || assignImpl;
  23. }
  24. exports.getAssign = getAssign;
  25. exports.assign = getAssign(root_1.root);
  26. //# sourceMappingURL=assign.js.map