blob: b562317c0074f0ad5a30a9f651d99a65b997f399 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
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;
|