defineEnumerableProperties.js 254 B

12345678910
  1. export default (function (obj, descs) {
  2. for (var key in descs) {
  3. var desc = descs[key];
  4. desc.configurable = desc.enumerable = true;
  5. if ("value" in desc) desc.writable = true;
  6. Object.defineProperty(obj, key, desc);
  7. }
  8. return obj;
  9. });