baseAssignValue.js 599 B

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