<commit_before>
const _ = require('lodash');

const DEFAULT_COLOUR = 'gray';

class ColourRegistry {

    constructor(params) {
        this._configStore = params.configStore;
        this._inUseColours = [];
    }

    issue() {
        const colours = this._configStore.get('highlightColors');
        const availableColour = colours.find(colour => !_.includes(this._inUseColours, colour));
        const newColour = availableColour || DEFAULT_COLOUR;
        this._inUseColours = this._inUseColours.concat(newColour);
        return newColour;
    }

    revoke(colour) {
        this._inUseColours = this._inUseColours.filter(c => c !== colour);
    }

}

module.exports = ColourRegistry;<commit_msg>Use native Array#includes instead of one in lodash<commit_after>
const DEFAULT_COLOUR = 'gray';

class ColourRegistry {

    constructor(params) {
        this._configStore = params.configStore;
        this._inUseColours = [];
    }

    issue() {
        const colours = this._configStore.get('highlightColors');
        const availableColour = colours.find(colour => !this._inUseColours.includes(colour));
        const newColour = availableColour || DEFAULT_COLOUR;
        this._inUseColours = this._inUseColours.concat(newColour);
        return newColour;
    }

    revoke(colour) {
        this._inUseColours = this._inUseColours.filter(c => c !== colour);
    }

}

module.exports = ColourRegistry;
{'fraction_non_alphanumeric': 0.11473087818696884, 'fraction_numerical': 0.0, 'mean_word_length': 3.1558823529411764, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '317630', 'n_tokens_mistral': 436, 'n_tokens_neox': 418, 'n_words': 75}