* Get a value from the cache * * @param {String} key
(key)
| 73 | * @param {String} key |
| 74 | */ |
| 75 | get (key) { |
| 76 | if (!key) return null |
| 77 | let value = this._cache[key] |
| 78 | if (value) return value |
| 79 | |
| 80 | value = this._miss(key) |
| 81 | |
| 82 | if (value) { |
| 83 | this.set(key, value) |
| 84 | } |
| 85 | return value |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Set a value in the cache |
no test coverage detected