You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
625 B

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