defineEnumerableProperties.js 855 B

1234567891011121314151617181920212223242526
  1. import _Object$defineProperty from "@babel/runtime-corejs3/core-js/object/define-property";
  2. import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js/object/get-own-property-symbols";
  3. export default function _defineEnumerableProperties(obj, descs) {
  4. for (var key in descs) {
  5. var desc = descs[key];
  6. desc.configurable = desc.enumerable = true;
  7. if ("value" in desc) desc.writable = true;
  8. _Object$defineProperty(obj, key, desc);
  9. }
  10. if (_Object$getOwnPropertySymbols) {
  11. var objectSymbols = _Object$getOwnPropertySymbols(descs);
  12. for (var i = 0; i < objectSymbols.length; i++) {
  13. var sym = objectSymbols[i];
  14. var desc = descs[sym];
  15. desc.configurable = desc.enumerable = true;
  16. if ("value" in desc) desc.writable = true;
  17. _Object$defineProperty(obj, sym, desc);
  18. }
  19. }
  20. return obj;
  21. }