mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
16 lines
397 B
JavaScript
16 lines
397 B
JavaScript
var hashHas = require('./_hashHas');
|
|
|
|
/**
|
|
* Removes `key` and its value from the hash.
|
|
*
|
|
* @private
|
|
* @param {Object} hash The hash to modify.
|
|
* @param {string} key The key of the value to remove.
|
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
*/
|
|
function hashDelete(hash, key) {
|
|
return hashHas(hash, key) && delete hash[key];
|
|
}
|
|
|
|
module.exports = hashDelete;
|