<commit_before>import { Injectable } from '@angular/core';

@Injectable()
export class StorageService {
    private storage: Storage;

    constructor() {
        this.storage = window.localStorage;
    }
    get(key: string) {
        return JSON.parse(this.storage.getItem(key));
    }
    set(key: string, value:any) {
        this.storage.setItem(key, JSON.stringify(value));
    }
    pop(key: string) {
        let result = this.get(key);
        this.storage.removeItem(key);
        
        return result;
    }
}<commit_msg>Added default to get()<commit_after>import { Injectable } from '@angular/core';
import any = jasmine.any;

@Injectable()
export class StorageService {
    private storage: Storage;

    constructor() {
        this.storage = window.localStorage;
    }
    get(key: string, defaultvalue: any = null) {
        try {
            return JSON.parse(this.storage.getItem(key));
        }
        catch (e) {
            return defaultvalue;
        }
    }
    set(key: string, value:any) {
        this.storage.setItem(key, JSON.stringify(value));
    }
    pop(key: string) {
        let result = this.get(key);
        this.storage.removeItem(key);

        return result;
    }
}
{'fraction_non_alphanumeric': 0.12788778877887788, 'fraction_numerical': 0.0, 'mean_word_length': 2.3324175824175826, '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': '1443366', 'n_tokens_mistral': 368, 'n_tokens_neox': 366, 'n_words': 76}