<commit_before>export const CURRENT_STEP = 'GUIDED_TOUR_CURRENT_STEP';
export const COMPLETED_STEPS = 'GUIDED_TOUR_COMPLETED_STEPS';
const parse = JSON.parse;
const stringify = JSON.stringify;

const persistStateToLocaleStorage = {
  clear() {
    localStorage.removeItem(CURRENT_STEP);
    localStorage.removeItem(COMPLETED_STEPS);
  },
  addCompletedStep: completedStep => {
    const currentSteps = parse(localStorage.getItem(COMPLETED_STEPS))?.slice() || [];
    const isAlreadyStored = currentSteps.includes(completedStep);

    if (isAlreadyStored) {
      return;
    }

    currentSteps.push(completedStep);
    localStorage.setItem(COMPLETED_STEPS, stringify(currentSteps));
  },
  addCurrentStep: currentStep => {
    console.log('yopo');
    localStorage.setItem(CURRENT_STEP, stringify(currentStep));
  },
  get: item => {
    return JSON.parse(localStorage.getItem(item));
  },
};<commit_msg>fix: feedbacks<commit_after>export const CURRENT_STEP = 'GUIDED_TOUR_CURRENT_STEP';
export const COMPLETED_STEPS = 'GUIDED_TOUR_COMPLETED_STEPS';
const parse = JSON.parse;
const stringify = JSON.stringify;

const persistStateToLocaleStorage = {
  clear() {
    localStorage.removeItem(CURRENT_STEP);
    localStorage.removeItem(COMPLETED_STEPS);
  },
  addCompletedStep: completedStep => {
    const currentSteps = parse(localStorage.getItem(COMPLETED_STEPS))?.slice() || [];
    const isAlreadyStored = currentSteps.includes(completedStep);

    if (isAlreadyStored) {
      return;
    }

    currentSteps.push(completedStep);
    localStorage.setItem(COMPLETED_STEPS, stringify(currentSteps));
  },
  addCurrentStep: currentStep => {
    localStorage.setItem(CURRENT_STEP, stringify(currentStep));
  },
  get: item => {
    return JSON.parse(localStorage.getItem(item));
  },
};
{'fraction_non_alphanumeric': 0.11814109742441209, 'fraction_numerical': 0.0, 'mean_word_length': 5.162068965517242, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2020250', 'n_tokens_mistral': 598, 'n_tokens_neox': 588, 'n_words': 84}