objectSpread.js 715 B

12345678910111213141516171819202122
  1. var defineProperty = require("./defineProperty.js");
  2. function _objectSpread(target) {
  3. for (var i = 1; i < arguments.length; i++) {
  4. var source = arguments[i] != null ? Object(arguments[i]) : {};
  5. var ownKeys = Object.keys(source);
  6. if (typeof Object.getOwnPropertySymbols === 'function') {
  7. ownKeys.push.apply(ownKeys, Object.getOwnPropertySymbols(source).filter(function (sym) {
  8. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  9. }));
  10. }
  11. ownKeys.forEach(function (key) {
  12. defineProperty(target, key, source[key]);
  13. });
  14. }
  15. return target;
  16. }
  17. module.exports = _objectSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;