您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920
  1. var castPath = require('./_castPath'),
  2. last = require('./last'),
  3. parent = require('./_parent'),
  4. toKey = require('./_toKey');
  5. /**
  6. * The base implementation of `_.unset`.
  7. *
  8. * @private
  9. * @param {Object} object The object to modify.
  10. * @param {Array|string} path The property path to unset.
  11. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  12. */
  13. function baseUnset(object, path) {
  14. path = castPath(path, object);
  15. object = parent(object, path);
  16. return object == null || delete object[toKey(last(path))];
  17. }
  18. module.exports = baseUnset;