<commit_before>var modes = {
    "immediate": require('./immediate-action'),
    "daemon": require('./daemon-action')
};

function ActionManager(spec) {
    this.actionList = [];
    this.actionDict = {};

    for (var id in spec) {
        if (!spec.hasOwnProperty(id)) continue;
        var actionSpec = spec[id];

        var mode = actionSpec.mode || "immediate";
        if (!modes.hasOwnProperty(mode)) {
            throw new Error("Invalid mode specified for action " + id);
        }

        var constructor = modes[mode];
        this.push(new constructor(id, actionSpec));
    }
}

ActionManager.prototype.push = function (action) {
    this.actionDict[action.id] = action;
    this.actionList.push(action);
};

ActionManager.prototype.get = function (id) {
    if (!this.actionDict.hasOwnProperty(id)) return undefined;
    return this.actionDict[id];
};

module.exports = ActionManager;<commit_msg>Removed overly dougly use of hasOwnProperty<commit_after>var modes = {
    "immediate": require('./immediate-action'),
    "daemon": require('./daemon-action')
};

function ActionManager(spec) {
    this.actionList = [];
    this.actionDict = {};

    for (var id in spec) {
        var actionSpec = spec[id];

        var mode = actionSpec.mode || "immediate";
        if (!modes.hasOwnProperty(mode)) {
            throw new Error("Invalid mode specified for action " + id);
        }

        var constructor = modes[mode];
        this.push(new constructor(id, actionSpec));
    }
}

ActionManager.prototype.push = function (action) {
    this.actionDict[action.id] = action;
    this.actionList.push(action);
};

ActionManager.prototype.get = function (id) {
    if (!this.actionDict.hasOwnProperty(id)) return undefined;
    return this.actionDict[id];
};

module.exports = ActionManager;
{'fraction_non_alphanumeric': 0.14119601328903655, 'fraction_numerical': 0.0, 'mean_word_length': 3.106818181818182, 'pattern_counts': {'":': 4, '<': 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': '882978', 'n_tokens_mistral': 531, 'n_tokens_neox': 527, 'n_words': 117}