dist/storage-helper.js
function getItem(key) {
  var parsed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var fallbackValue = arguments[2];

  var result = void 0;

  var cookieItem = cookie$1.getItem(key);
  var sessionItem = session.getItem(key);

  if (!hasLocalStorage()) {
    result = cookieItem || sessionItem;
  } else {
    result = localstorage.getItem(key) || cookieItem || sessionItem;
  }

  var item = parsed ? parse(result) : result;

  if ((typeof item === 'undefined' || item === null) && typeof fallbackValue !== 'undefined') {
    return fallbackValue;
  }

  return item;
}
function getItem(key) {
  var parsed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  var fallbackValue = arguments[2];

  var result = void 0;

  var cookieItem = cookie$1.getItem(key);
  var sessionItem = session.getItem(key);

  if (!hasLocalStorage()) {
    result = cookieItem || sessionItem;
  } else {
    result = localstorage.getItem(key) || cookieItem || sessionItem;
  }

  var item = parsed ? parse(result) : result;

  if ((typeof item === 'undefined' || item === null) && typeof fallbackValue !== 'undefined') {
    return fallbackValue;
  }

  return item;
}
function getItem ( key ) { var parsed = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : false ; var fallbackValue = arguments [ 2 ] ; var result = void 0 ; var cookieItem = cookie$1 . getItem ( key ) ; var sessionItem = session . getItem ( key ) ; if ( ! hasLocalStorage ( ) ) { result = cookieItem || sessionItem ; } else { result = localstorage . getItem ( key ) || cookieItem || sessionItem ; } var item = parsed ? parse ( result ) : result ; if ( ( typeof item === 'undefined' || item === null ) && typeof fallbackValue !== 'undefined' ) { return fallbackValue ; } return item ; }
Get the item
Here the object is taken from the localStorage, if it was available, or from the object
@param  {String}  key
@param  {Boolean} [parsed=false]
@return {any}
Get the item Here the object is taken from the localStorage if it was available or from the object