baseAssignValue.cjs 679 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. /**
  4. * The base implementation of `assignValue` and `assignMergeValue` without
  5. * value checks.
  6. *
  7. * @private
  8. * @param {Object} object The object to modify.
  9. * @param {string} key The key of the property to assign.
  10. * @param {*} value The value to assign.
  11. */
  12. function baseAssignValue(object, key, value) {
  13. if (key === "__proto__") {
  14. Object.defineProperty(object, key, {
  15. configurable: true,
  16. enumerable: true,
  17. value: value,
  18. writable: true,
  19. });
  20. }
  21. else {
  22. object[key] = value;
  23. }
  24. }
  25. exports.default = baseAssignValue;