UNPKG

cache-kit

Version:

A simple caching layer for fetch requests — supports memory, browser (localStorage), and Node.js (filesystem) adapters with smart strategies.

14 lines (12 loc) 295 B
// src/utils/common.util.ts var getExpiryTimeCacheKey = (expirySeconds) => { if (!expirySeconds) return Infinity; const expiryTime = Date.now() + expirySeconds * 1e3; return expiryTime; }; var makeKey = (key) => `__CACHE_KIT__::${key}`; export { getExpiryTimeCacheKey, makeKey };