import { l as localforage } from './localforage-9915b7c8.js';
import { g as getCache } from './getCache-f7c123d8.js';

async function clearCache(key) {
  let data = key ? await getCache(key, null) : null;
  try {
    if (key) {
      await localforage.removeItem(key);
    }
    else {
      await localforage.clear();
    }
  }
  catch (error) {
    console.log("Error clearing data from cache with localforage", error);
  }
  try {
    if (key) {
      localStorage.removeItem(key);
    }
    else {
      localStorage.clear();
    }
  }
  catch (err) {
    console.log("Error clearing data from cache with LocalStorage", err);
  }
  return data;
}

export { clearCache as c };

//# sourceMappingURL=clearCache-e14559c6.js.map