iridium
Version:
A custom lightweight ORM for MongoDB designed for power-users
115 lines (113 loc) • 3.78 kB
HTML
<html lang="en">
<head>
<title>Code coverage report for dist\lib\caches\MemoryCache.js</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../../../prettify.css">
<link rel="stylesheet" href="../../../base.css">
<style type='text/css'>
div.coverage-summary .sorter {
background-image: url(../../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class="header high">
<h1>Code coverage report for <span class="entity">dist\lib\caches\MemoryCache.js</span></h1>
<h2>
Statements: <span class="metric">100% <small>(16 / 16)</small></span>
Branches: <span class="metric">100% <small>(2 / 2)</small></span>
Functions: <span class="metric">100% <small>(5 / 5)</small></span>
Lines: <span class="metric">100% <small>(16 / 16)</small></span>
Ignored: <span class="metric"><span class="ignore-none">none</span></span>
</h2>
<div class="path"><a href="../../../index.html">All files</a> » <a href="index.html">dist/lib/caches/</a> » MemoryCache.js</div>
</div>
<div class="body">
<pre><table class="coverage">
<tr><td class="line-count">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24</td><td class="line-coverage"><span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">8</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">19</span>
<span class="cline-any cline-yes">19</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">9</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-yes">6</span>
<span class="cline-any cline-yes">6</span>
<span class="cline-any cline-yes">5</span>
<span class="cline-any cline-yes">6</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-yes">1</span>
<span class="cline-any cline-neutral"> </span>
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">/// <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</pre></td></tr>
</table></pre>
</div>
<div class="footer">
<div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jun 18 2015 14:55:18 GMT+0200 (South Africa Standard Time)</div>
</div>
<script src="../../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../../sorter.js"></script>
</body>
</html>