<commit_before>var TYPES = [
    'MELEE_PHYSICAL',
    'RANGED_PHYSICAL',
    'FIRE',
    'COLD',
    'ELECTRICAL',
    'ENERGY',
    'POISON'
];

var TYPE_MAP = TYPES.reduce((obj, type) => {
    obj[type] = type;
    return obj;
}, {});

export default new Proxy(TYPE_MAP, {
    get: function(obj, prop) {
        var value = obj[prop];
        if(typeof value === 'undefined') {
            throw new Error(`Unrecognized damage type: ${prop}. Choose from: ${Object.keys(obj)}`);
        } else {
            return value;
        }
    }
});<commit_msg>Feature detecting Proxy<commit_after>var TYPES = [
    'MELEE_PHYSICAL',
    'RANGED_PHYSICAL',
    'FIRE',
    'COLD',
    'ELECTRICAL',
    'ENERGY',
    'POISON'
];

var TYPE_MAP = TYPES.reduce((obj, type) => {
    obj[type] = type;
    return obj;
}, {});

var TYPES = (typeof Proxy === 'undefined') ? TYPE_MAP : new Proxy(TYPE_MAP, {
    get: function(obj, prop) {
        var value = obj[prop];
        if(typeof value === 'undefined') {
            throw new Error(`Unrecognized damage type: ${prop}. Choose from: ${Object.keys(obj)}`);
        } else {
            return value;
        }
    }
});

export default TYPES;
{'fraction_non_alphanumeric': 0.16469594594594594, 'fraction_numerical': 0.0, 'mean_word_length': 2.4347826086956523, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6974861', 'n_tokens_mistral': 419, 'n_tokens_neox': 417, 'n_words': 93}