()
| 182 | // because the cache would otherwise be loaded |
| 183 | // only once when the index file is parsed |
| 184 | async loadCache() { |
| 185 | const { latest, refreshCache, isOutdated, lastUpdate } = this |
| 186 | |
| 187 | if (!lastUpdate || isOutdated()) { |
| 188 | await refreshCache() |
| 189 | } |
| 190 | |
| 191 | return Object.assign({}, latest) |
| 192 | } |
| 193 | } |