1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | var util = require('util')
|
10 | var Store = require('istanbul').Store
|
11 |
|
12 |
|
13 | var SourceCacheStore = module.exports = function (opts) {
|
14 | Store.call(this, opts)
|
15 | opts = opts || {}
|
16 | this.sourceCache = opts.sourceCache
|
17 | }
|
18 |
|
19 |
|
20 |
|
21 | SourceCacheStore.TYPE = 'sourceCacheLookup'
|
22 |
|
23 |
|
24 | util.inherits(SourceCacheStore, Store)
|
25 |
|
26 |
|
27 | Store.mix(SourceCacheStore, {
|
28 | keys: function () {
|
29 | throw new Error('Not implemented')
|
30 | },
|
31 | get: function (key) {
|
32 | return this.sourceCache[key]
|
33 | },
|
34 | hasKey: function (key) {
|
35 | return this.sourceCache.hasOwnProperty(key)
|
36 | },
|
37 | set: function (key, contents) {
|
38 | throw new Error('Not applicable')
|
39 | }
|
40 | })
|