defineEnumerableProperties.js 973 B

12345678910111213141516171819202122232425262728293031
  1. var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
  2. var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js/object/get-own-property-symbols");
  3. 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. }
  22. module.exports = _defineEnumerableProperties;
  23. module.exports["default"] = module.exports, module.exports.__esModule = true;