function parseLocalStorage (localStorageItem) {
  let data;
  try {
    data = JSON.parse(localStorageItem);
  } catch (error) {
    console.error(error);
    console.warn('BackstopJS LocalStorage settings appear to be corrupted. Let me fix that for you.');
    localStorage.removeItem('backstopjs');
    data = false;
  }
  return data;
}
Parses a JSON string from local storage and handles any errors.

This function attempts to parse a JSON string provided in `localStorageItem`.
If the parsing fails (typically due to corrupt or invalid JSON data),
it logs the error, warns the user, and removes the corrupted item from
local storage. If parsing is successful, it returns the parsed object.
In the case of an error, it returns `false`.

@param {string} localStorageItem - The JSON string to parse, typically retrieved from local storage.
@returns {object|boolean} The parsed JSON object, or `false` if settings aren't set or parsing fails.