<commit_before>var serialize = function(value) {
    return JSON.stringify(value);
};

var deserialize = function(value) {
    return value === undefined || value === '' ? value : JSON.parse(value);
};

return {
    get: function(storage, genkey, err) {
        try {
            return deserialize(storage.getItem(genkey));
        } catch(e) {
            if (err) { err(e); }
        }
    },

    set: function(storage, genkey, value, err) {
        try {
            storage.setItem(genkey, serialize(value));
        } catch(e) {
            if (err) { err(e); }
        }
    },


    remove: function(storage, genkey, err) {
        try {
            return storage.removeItem(genkey);
        } catch(e) {
            if (err) { err(e); }
        }
    },
};<commit_msg>minor: spacing<commit_after>var serialize = function(value) {
    return JSON.stringify(value);
};

var deserialize = function(value) {
    return value === undefined || value === '' ? value : JSON.parse(value);
};

return {
    get: function(storage, genkey, err) {
        try {
            return deserialize(storage.getItem(genkey));
        } catch(e) {
            if (err) { err(e); }
        }
    },

    set: function(storage, genkey, value, err) {
        try {
            storage.setItem(genkey, serialize(value));
        } catch(e) {
            if (err) { err(e); }
        }
    },

    remove: function(storage, genkey, err) {
        try {
            return storage.removeItem(genkey);
        } catch(e) {
            if (err) { err(e); }
        }
    },
};
{'fraction_non_alphanumeric': 0.1534017971758665, 'fraction_numerical': 0.0, 'mean_word_length': 1.8605504587155963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '56226', 'n_tokens_mistral': 488, 'n_tokens_neox': 482, 'n_words': 99}