'use strict';

// import localforage from "localforage";
function getCache(key, defaultValue) {
  let data = null;
  // try {
  //   data = await localforage?.getItem?.(key);
  // } catch (error) {
  // console.log("Error fetching data from cache with localforage", error);
  try {
    data = localStorage.getItem(key)
      ? JSON.parse(localStorage.getItem(key))
      : null;
    console.log(key, data);
  }
  catch (err) {
    console.log("Error fetching data from cache with LocalStorage", err);
  }
  // }
  return data === null && typeof defaultValue !== "undefined"
    ? defaultValue
    : data;
}

exports.getCache = getCache;

//# sourceMappingURL=getCache-901b0f67.js.map