mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
20 lines
467 B
JavaScript
20 lines
467 B
JavaScript
var assocDelete = require('./_assocDelete');
|
|
|
|
/**
|
|
* Removes `key` and its value from the stack.
|
|
*
|
|
* @private
|
|
* @name delete
|
|
* @memberOf Stack
|
|
* @param {string} key The key of the value to remove.
|
|
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
*/
|
|
function stackDelete(key) {
|
|
var data = this.__data__,
|
|
array = data.array;
|
|
|
|
return array ? assocDelete(array, key) : data.map['delete'](key);
|
|
}
|
|
|
|
module.exports = stackDelete;
|