objectSpread2.js 843 B

1234567891011121314151617181920212223
  1. import defineProperty from "./defineProperty.js";
  2. function ownKeys(e, r) {
  3. var t = Object.keys(e);
  4. if (Object.getOwnPropertySymbols) {
  5. var o = Object.getOwnPropertySymbols(e);
  6. r && (o = o.filter(function (r) {
  7. return Object.getOwnPropertyDescriptor(e, r).enumerable;
  8. })), t.push.apply(t, o);
  9. }
  10. return t;
  11. }
  12. function _objectSpread2(e) {
  13. for (var r = 1; r < arguments.length; r++) {
  14. var t = null != arguments[r] ? arguments[r] : {};
  15. r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
  16. defineProperty(e, r, t[r]);
  17. }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
  18. Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
  19. });
  20. }
  21. return e;
  22. }
  23. export { _objectSpread2 as default };