<commit_before>var objectMerge = require('../objectMerge');

function BaseElement () {}

BaseElement.prototype.constructor = function (data, Fixture) {
    this.data = data;
    this.Fixture = Fixture;
}

BaseElement.prototype.setMasterbrand = function (id, name) {
    if (name === undefined) {
        name = id;
    }

    this.data.master_brand.id = id

    if (id !== '') {
        this.data.master_brand.attribution = id + '_attr'
    }

    if (name !== '') {
        this.data.master_brand.titles.small = name + ' small'
        this.data.master_brand.titles.medium = name + ' medium'
        this.data.master_brand.titles.large = name + ' large'
    }

    return this;
}

BaseElement.prototype.set = function (data) {
    objectMerge(true, this.data, data);
    return this;
}

BaseElement.prototype.clone = function() {
    return this.Fixture.Factory(JSON.parse(JSON.stringify(this.data)));
};

module.exports = BaseElement<commit_msg>Allowing setting a 'blank' master brand, just 'BBC' instead of appending small, med, large<commit_after>var objectMerge = require('../objectMerge');

function BaseElement () {}

BaseElement.prototype.constructor = function (data, Fixture) {
    this.data = data;
    this.Fixture = Fixture;
}

BaseElement.prototype.setMasterbrand = function (id, name) {
    if (name === undefined) {
        name = id;
    }

    this.data.master_brand.id = id

    if (id !== '') {
        this.data.master_brand.attribution = id + '_attr'
    }

    if (name !== '') {
        this.data.master_brand.titles.small = name
        this.data.master_brand.titles.medium = name
        this.data.master_brand.titles.large = name
    }

    if (name === '') {
        this.data.master_brand.titles.small = name + ' small'
        this.data.master_brand.titles.medium = name + ' medium'
        this.data.master_brand.titles.large = name + ' large'
    }

    return this;
}

BaseElement.prototype.set = function (data) {
    objectMerge(true, this.data, data);
    return this;
}

BaseElement.prototype.clone = function() {
    return this.Fixture.Factory(JSON.parse(JSON.stringify(this.data)));
};

module.exports = BaseElement
{'fraction_non_alphanumeric': 0.14153132250580047, 'fraction_numerical': 0.0, 'mean_word_length': 2.934306569343066, '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': '7559724', 'n_tokens_mistral': 686, 'n_tokens_neox': 673, 'n_words': 132}