export function getCache(name) {
    if (name == undefined || name == "") {
        return "";
    }
    //let result = localStorage.getItem(name);
    let result = sessionStorage.getItem(name);
    if (result!= null) {
      if ((result.startsWith("{") && result.endsWith("}")) || (result.startsWith("[") && result.endsWith("]"))) {
        result = JSON.parse(result); 
      } 
    }
    return result;
  }
  
  export function setCache(name, value) {
    if (name == undefined || name == "") {
        return false; 
    }
    if(typeof value === 'object') {
      value = JSON.stringify(value);
    }
    //let result = localStorage.setItem(name, value);
    let result = sessionStorage.setItem(name, value);
    return result;
  }  
  export function clearStorage() {
    sessionStorage.clear();
    //localStorage.clear();
  }