Code coverage report for dist\lib\caches\MemoryCache.js

Statements: 100% (16 / 16)      Branches: 100% (2 / 2)      Functions: 100% (5 / 5)      Lines: 100% (16 / 16)      Ignored: none     

All files » dist/lib/caches/ » MemoryCache.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  1 1 1 8   1 19 19   1 9   1 6 6 5 6   1   1    
/// <reference path="../../_references.d.ts" />
var Bluebird = require('bluebird');
var MemoryCache = (function () {
    function MemoryCache() {
        this.cache = {};
    }
    MemoryCache.prototype.set = function (key, value) {
        this.cache[key] = value;
        return Bluebird.resolve(value);
    };
    MemoryCache.prototype.get = function (key) {
        return Bluebird.resolve(this.cache[key]);
    };
    MemoryCache.prototype.clear = function (key) {
        var has = this.cache.hasOwnProperty(key);
        if (has)
            delete this.cache[key];
        return Bluebird.resolve(has);
    };
    return MemoryCache;
})();
exports.default = MemoryCache;
 
//# sourceMappingURL=../../lib/caches/MemoryCache.js.map