(url: string, now = Date.now())
| 21 | }; |
| 22 | |
| 23 | const add = (url: string, now = Date.now()): void => { |
| 24 | cache.delete(url); |
| 25 | cache.set(url, now + NO_POST_CACHE_TTL); |
| 26 | if (cache.size > NO_POST_CACHE_MAX_SIZE) { |
| 27 | cache.delete(cache.keys().next().value as string); |
| 28 | } |
| 29 | }; |
| 30 | |
| 31 | return { has, add }; |
| 32 | }; |
no test coverage detected