<commit_before>'use strict';

module.exports = (from, to, all) => {
    check(from, to, all);
    
    const includes = number =>
        ~all.indexOf(number);
    
    const getMissing= numbers =>
        numbers.filter(number=> !includes(number))[0];
    
    const half = Math.round((to - from + 1) / 2);
    const middle = from + half - 1;
    
    if (!includes(half))
        return half;
    
    for(;from < middle, to > middle; ++from, --to) {
        let free = getMissing([from, to]);
        
        if (free)
            return free;
    }};

function check(from, to, all) {
    if (typeof from !== 'number')
        throw Error('from should be number!');
    
    if (typeof to !== 'number')
        throw Error('to should be number!');
    
    if (from > to)
        throw Error('from could not be bigger then to!');
    
    if (!Array.isArray(all))
        throw Error('all should be an array!');
}

<commit_msg>chore(find-missing) add " "<commit_after>'use strict';

module.exports = (from, to, all) => {
    check(from, to, all);
    
    const includes = number =>
        ~all.indexOf(number);
    
    const getMissing = numbers =>
        numbers.filter(number=> !includes(number))[0];
    
    const half = Math.round((to - from + 1) / 2);
    const middle = from + half - 1;
    
    if (!includes(half))
        return half;
    
    for(; from < middle, to > middle; ++from, --to) {
        let free = getMissing([from, to]);
        
        if (free)
            return free;
        
    }};

function check(from, to, all) {
    if (typeof from !== 'number')
        throw Error('from should be number!');
    
    if (typeof to !== 'number')
        throw Error('to should be number!');
    
    if (from > to)
        throw Error('from could not be bigger then to!');
    
    if (!Array.isArray(all))
        throw Error('all should be an array!');
}


{'fraction_non_alphanumeric': 0.15209326974032855, 'fraction_numerical': 0.0042395336512983575, 'mean_word_length': 2.015974440894569, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '7278064', 'n_tokens_mistral': 587, 'n_tokens_neox': 581, 'n_words': 179}