File size: 756 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
Object.defineProperty(exports, '__esModule', { value: true })

const cache = new Map()

const CacheHandler = /** @class */ (function () {
  function CacheHandler(options) {
    this.options = options
    this.cache = cache
    console.log('initialized custom cache-handler')
    console.log('cache handler - cjs default export')
  }
  CacheHandler.prototype.get = function (key) {
    console.log('cache-handler get', key)
    return Promise.resolve(this.cache.get(key))
  }
  CacheHandler.prototype.set = function (key, data) {
    console.log('cache-handler set', key)
    this.cache.set(key, {
      value: data,
      lastModified: Date.now(),
    })
    return Promise.resolve(undefined)
  }
  return CacheHandler
})()

exports.default = CacheHandler