mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Add mapDelete.
This commit is contained in:
14
lodash.js
14
lodash.js
@@ -1445,6 +1445,19 @@
|
||||
this.__data__ = {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the cache.
|
||||
*
|
||||
* @private
|
||||
* @name get
|
||||
* @memberOf _.memoize.Cache
|
||||
* @param {string} key The key of the value to remove.
|
||||
* @returns {boolean} Returns `true` if the entry was removed successfully, else `false`.
|
||||
*/
|
||||
function mapDelete(key) {
|
||||
return delete this.__data__[key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cached value for `key`.
|
||||
*
|
||||
@@ -9970,6 +9983,7 @@
|
||||
LodashWrapper.prototype = lodash.prototype;
|
||||
|
||||
// Add functions to the `Map` cache.
|
||||
MapCache.prototype['delete'] = mapDelete;
|
||||
MapCache.prototype.get = mapGet;
|
||||
MapCache.prototype.has = mapHas;
|
||||
MapCache.prototype.set = mapSet;
|
||||
|
||||
Reference in New Issue
Block a user