<commit_before>export const local = {
    get(key) {
        return JSON.parse(localStorage.getItem(key));
    },
    add(key, value) {
        let storageValue = this.get(key);
        if (!storageValue) {
            this.set(key, JSON.stringify([]));
            storageValue = [];
        }

        let index = storageValue.findIndex(e => e.login == value.login);
        if (index == -1) storageValue.push({ ...value, lastView: new Date()});
        else storageValue[index].lastView = new Date();

        this.set(key, storageValue);
    },
    set(key, value) {
        localStorage.setItem(key, JSON.stringify(value));
    },
    remove(key) {
        localStorage.removeItem(key);
    }
};

export const session = {
    get(key) {
        return JSON.parse(sessionStorage.getItem(key));
    },
    set(key, value) {
        sessionStorage.setItem(key, JSON.stringify(value));
    }
};

export const keys = {
    MOST_VIEWED: 'MOST_VIEWED',
    LAST_SEARCH: 'LAST_SEARCH'
}<commit_msg>feat(StorageService): add new key to the application settings<commit_after>export const local = {
    get(key) {
        return JSON.parse(localStorage.getItem(key));
    },
    add(key, value) {
        let storageValue = this.get(key);
        if (!storageValue) {
            this.set(key, JSON.stringify([]));
            storageValue = [];
        }

        let index = storageValue.findIndex(e => e.login == value.login);
        if (index == -1) storageValue.push({ ...value, lastView: new Date()});
        else storageValue[index].lastView = new Date();

        this.set(key, storageValue);
    },
    set(key, value) {
        localStorage.setItem(key, JSON.stringify(value));
    },
    remove(key) {
        localStorage.removeItem(key);
    }
};

export const session = {
    get(key) {
        return JSON.parse(sessionStorage.getItem(key));
    },
    set(key, value) {
        sessionStorage.setItem(key, JSON.stringify(value));
    }
};

export const keys = {
    MOST_VIEWED: 'MOST_VIEWED',
    LAST_SEARCH: 'LAST_SEARCH',
    SETTINGS: 'SETTINGS'
}
{'fraction_non_alphanumeric': 0.14970930232558138, 'fraction_numerical': 0.0009689922480620155, 'mean_word_length': 2.4764309764309766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5977614', 'n_tokens_mistral': 646, 'n_tokens_neox': 643, 'n_words': 125}