项目原始demo,不改动
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Repozitorijs ir arhivēts. Tam var aplūkot failus un to var klonēt, bet nevar iesūtīt jaunas izmaiņas, kā arī atvērt jaunas problēmas/izmaiņu pieprasījumus.
 
 
 
 

27 rindas
409 B

  1. 'use strict';
  2. var Cache = module.exports = function Cache() {
  3. this._cache = {};
  4. };
  5. Cache.prototype.put = function Cache_put(key, value) {
  6. this._cache[key] = value;
  7. };
  8. Cache.prototype.get = function Cache_get(key) {
  9. return this._cache[key];
  10. };
  11. Cache.prototype.del = function Cache_del(key) {
  12. delete this._cache[key];
  13. };
  14. Cache.prototype.clear = function Cache_clear() {
  15. this._cache = {};
  16. };