<commit_before>'use strict';

const {app} = require('electron').remote;
const JsonDB = require('node-json-db');

class DomainUtil {
    constructor() {
        this.db = new JsonDB(app.getPath('userData') + '/domain.json', true, true);
    }

    getDomains() {
        return this.db.getData('/domains');
    }

    addDomain() {
        const servers = {
            url: 'https://chat.zulip.org',
            alias: 'Zulip 2',
            avatar: 'https://chat.zulip.org/static/images/logo/zulip-icon-128x128.271d0f6a0ca2.png'
        }
        db.push("/domains[]", servers, true);
    }
}

module.exports = DomainUtil;<commit_msg>Change domain config schema and update DomainUtil.<commit_after>'use strict';

const {app} = require('electron').remote;
const JsonDB = require('node-json-db');

class DomainUtil {
    constructor() {
        this.db = new JsonDB(app.getPath('userData') + '/domain.json', true, true);
    }

    getDomains() {
        return this.db.getData('/domains');
    }

    addDomain() {
        const servers = {
            url: 'https://chat.zulip.org',
            alias: 'Zulip 2333',
            icon: 'https://chat.zulip.org/static/images/logo/zulip-icon-128x128.271d0f6a0ca2.png'
        }
        this.db.push("/domains[]", servers, true);
    }

    removeDomains() {
        this.db.delete("/domains");
    }
}

module.exports = DomainUtil;
{'fraction_non_alphanumeric': 0.16690856313497823, 'fraction_numerical': 0.022496371552975326, 'mean_word_length': 2.438902743142145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '1348863', 'n_tokens_mistral': 485, 'n_tokens_neox': 452, 'n_words': 77}