* Set a value in the cache * * @param {String} key * @param {Mixed} value
(key, value)
| 92 | * @param {Mixed} value |
| 93 | */ |
| 94 | set (key, value) { |
| 95 | if (!key || !value) return false |
| 96 | this._cache[key] = value |
| 97 | if (this._ttl_time) { |
| 98 | this._ttl[key] = dayjs().add(this._ttl_time, 'seconds') |
| 99 | } |
| 100 | return true |
| 101 | } |
| 102 | |
| 103 | reset () { |
| 104 | this._cache = null |
no test coverage detected