<commit_before>/*jshint evil: false, bitwise:false, strict: false, undef: true, white: false, plusplus:false, node:true */

//reimplemented this since it needs to work in the browser as well
function combinePath(base, relative) {
    if(isRelative(relative)) {
        var relativeParts = relative.split('/');
        var pathStack = base.split('/').filter(function(part) {return !!part;});
        relativeParts.forEach(function(part) {
            if(part === '..') {
                pathStack.pop();
            } else if( part !== '.') {
                pathStack.push(part);
            }
        });
        //only prepend starting slash if base had one
        var firstBaseCharIsSlash = base.substr(0,1) === '/';
        return  (firstBaseCharIsSlash ? '/' : '') + pathStack.join('/');
    }
    return relative;
}


function normalize(basePath, moduleName) {
    moduleName = combinePath(basePath || '', moduleName);

    if(moduleName.lastIndexOf('.js') === Math.max(1, moduleName.length - 3)) {
        moduleName = moduleName.substr(0, moduleName.length - 3);
    }
    return moduleName;
}

function isRelative(moduleName) {
    //start with a dot
    return moduleName.charAt(0) === '.';
}

module.exports = {
    combinePath: combinePath,
    normalize: normalize,
    isRelative: isRelative
};<commit_msg>fix lint error<commit_after>/*jshint evil: false, bitwise:false, strict: false, undef: true, white: false, plusplus:false, node:true */

function isRelative(moduleName) {
    //start with a dot
    return moduleName.charAt(0) === '.';
}

//reimplemented this since it needs to work in the browser as well
function combinePath(base, relative) {
    if(isRelative(relative)) {
        var relativeParts = relative.split('/');
        var pathStack = base.split('/').filter(function(part) {return !!part;});
        relativeParts.forEach(function(part) {
            if(part === '..') {
                pathStack.pop();
            } else if( part !== '.') {
                pathStack.push(part);
            }
        });
        //only prepend starting slash if base had one
        var firstBaseCharIsSlash = base.substr(0,1) === '/';
        return  (firstBaseCharIsSlash ? '/' : '') + pathStack.join('/');
    }
    return relative;
}


function normalize(basePath, moduleName) {
    moduleName = combinePath(basePath || '', moduleName);

    if(moduleName.lastIndexOf('.js') === Math.max(1, moduleName.length - 3)) {
        moduleName = moduleName.substr(0, moduleName.length - 3);
    }
    return moduleName;
}

module.exports = {
    combinePath: combinePath,
    normalize: normalize,
    isRelative: isRelative
};
{'fraction_non_alphanumeric': 0.14831630722663638, 'fraction_numerical': 0.0052970109723798715, 'mean_word_length': 2.718706047819972, 'pattern_counts': {'":': 0, '<': 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': '2677543', 'n_tokens_mistral': 790, 'n_tokens_neox': 775, 'n_words': 182}