objectSpread.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. var _Object$keys = require("@babel/runtime-corejs3/core-js/object/keys");
  2. var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js/object/get-own-property-symbols");
  3. var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/concat");
  4. var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/filter");
  5. var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptor");
  6. var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/for-each");
  7. var defineProperty = require("./defineProperty.js");
  8. function _objectSpread(target) {
  9. for (var i = 1; i < arguments.length; i++) {
  10. var source = arguments[i] != null ? Object(arguments[i]) : {};
  11. var ownKeys = _Object$keys(source);
  12. if (typeof _Object$getOwnPropertySymbols === 'function') {
  13. var _context;
  14. ownKeys = _concatInstanceProperty(ownKeys).call(ownKeys, _filterInstanceProperty(_context = _Object$getOwnPropertySymbols(source)).call(_context, function (sym) {
  15. return _Object$getOwnPropertyDescriptor(source, sym).enumerable;
  16. }));
  17. }
  18. _forEachInstanceProperty(ownKeys).call(ownKeys, function (key) {
  19. defineProperty(target, key, source[key]);
  20. });
  21. }
  22. return target;
  23. }
  24. module.exports = _objectSpread;
  25. module.exports["default"] = module.exports, module.exports.__esModule = true;