UNPKG

iridium

Version:

A custom lightweight ORM for MongoDB designed for power-users

118 lines (116 loc) 4.08 kB
<!doctype html> <html lang="en"> <head> <title>Code coverage report for dist\lib\ModelCache.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\ModelCache.js</span></h1> <h2> Statements: <span class="metric">100% <small>(18 / 18)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Branches: <span class="metric">100% <small>(12 / 12)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Functions: <span class="metric">100% <small>(5 / 5)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Lines: <span class="metric">100% <small>(18 / 18)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp; </h2> <div class="path"><a href="../../index.html">All files</a> &#187; <a href="index.html">dist/lib/</a> &#187; ModelCache.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 25</td><td class="line-coverage"><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">31</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">412</span> <span class="cline-any cline-yes">394</span> <span class="cline-any cline-yes">18</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">97</span> <span class="cline-any cline-yes">95</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-yes">76</span> <span class="cline-any cline-yes">72</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">var Bluebird = require('bluebird'); var ModelCache = (function () { function ModelCache(model) { this.model = model; } ModelCache.prototype.set = function (value) { if (!this.model.cacheDirector || !this.model.cacheDirector.valid(value)) return; this.model.core.cache.set(this.model.cacheDirector.buildKey(value), value); }; ModelCache.prototype.get = function (conditions) { if (!this.model.cacheDirector || !this.model.cacheDirector.validQuery(conditions)) return Bluebird.resolve(null); return this.model.core.cache.get(this.model.cacheDirector.buildQueryKey(conditions)); }; ModelCache.prototype.clear = function (conditions) { if (!this.model.cacheDirector || !this.model.cacheDirector.validQuery(conditions)) return; this.model.core.cache.clear(this.model.cacheDirector.buildQueryKey(conditions)); }; return ModelCache; })(); exports.default = ModelCache; &nbsp; //# sourceMappingURL=../lib/ModelCache.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 15:09:28 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>