MapCache.js 520 B

123456789101112131415161718192021222324
  1. var mapDelete = require('./mapDelete'),
  2. mapGet = require('./mapGet'),
  3. mapHas = require('./mapHas'),
  4. mapSet = require('./mapSet');
  5. /**
  6. * Creates a cache object to store key/value pairs.
  7. *
  8. * @private
  9. * @static
  10. * @name Cache
  11. * @memberOf _.memoize
  12. */
  13. function MapCache() {
  14. this.__data__ = {};
  15. }
  16. // Add functions to the `Map` cache.
  17. MapCache.prototype['delete'] = mapDelete;
  18. MapCache.prototype.get = mapGet;
  19. MapCache.prototype.has = mapHas;
  20. MapCache.prototype.set = mapSet;
  21. module.exports = MapCache;