defineProperty.js 444 B

12345678910111213141516
  1. var toPropertyKey = require("./toPropertyKey.js");
  2. function _defineProperty(obj, key, value) {
  3. key = toPropertyKey(key);
  4. if (key in obj) {
  5. Object.defineProperty(obj, key, {
  6. value: value,
  7. enumerable: true,
  8. configurable: true,
  9. writable: true
  10. });
  11. } else {
  12. obj[key] = value;
  13. }
  14. return obj;
  15. }
  16. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;