<commit_before>const ajax = function (conf) {
    return new Promise((resolve, reject) => {
        const xmlhttp = new XMLHttpRequest();

        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200 && conf.success)
                    resolve(conf.parse ? JSON.parse(xmlhttp.responseText) : xmlhttp.responseText);
                else
                    reject(xmlhttp.status, xmlhttp.statusText);
            }
        };

        let sent = null;

        if (conf.data) {
            const data = [];
            for (let i in conf.data)
                data.push(i + '=' + conf.data[i]);

            conf.type === 'GET' ? conf.url += '?' + data.join('&') : sent = data.join('&');
        }

        xmlhttp.open(conf.type, conf.url, conf.async === undefined || conf.async);

        if (sent) xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

        xmlhttp.send(sent);
    });
}

ajax()
    .then(fullfilled => console.log(fullfilled))
    .catch((status, statusText) => console.log('status ' + status + ', statusText ' + statusText));<commit_msg>Bug fixed: remove conf.success && remove debugger execution<commit_after>const ajax = function (conf) {
    return new Promise((resolve, reject) => {
        const xmlhttp = new XMLHttpRequest();

        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState == 4) {
                if (xmlhttp.status == 200)
                    resolve(conf.parse ? JSON.parse(xmlhttp.responseText) : xmlhttp.responseText);
                else
                    reject(xmlhttp.status, xmlhttp.statusText);
            }
        };
        let sent = null;
        if (conf.data) {
            const data = [];
            for (let i in conf.data)
                data.push(i + '=' + conf.data[i]);

            conf.type === 'GET' ? conf.url += '?' + data.join('&') : sent = data.join('&');
        }
        xmlhttp.open(conf.type, conf.url, conf.async === undefined || conf.async);
        if (sent) xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlhttp.send(sent);
    });
}
{'fraction_non_alphanumeric': 0.15191605839416059, 'fraction_numerical': 0.0036496350364963502, 'mean_word_length': 1.9515477792732168, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 22}, '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': '2241416', 'n_tokens_mistral': 651, 'n_tokens_neox': 618, 'n_words': 127}