'use strict';

const localforage = require('./localforage-af1b8c0e.js');
const getCache = require('./getCache-0269c4d0.js');

async function clearCache(key) {
  let data = key ? await getCache.getCache(key, null) : null;
  try {
    if (key) {
      await localforage.localforage.removeItem(key);
    }
    else {
      await localforage.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;
}

exports.clearCache = clearCache;

//# sourceMappingURL=clearCache-94708ed2.js.map