<commit_before>/*
 * generates
 * - all es6, amd and commonjs dependencies in the src tree
 */

var path  = require("path");
var madge = require("madge");
var utl   = require("./utl");
var fs    = require("fs");
var _     = require("lodash");

function sourcify (pBaseDir, pString){
    return path.join(
        pBaseDir, 
        pString + ".js"
    );
}

function addToMakefileString(pString, pAddition){
    return pString + " \\\n\t" + pAddition;
}

function getDepString(pArray, pStartWith){
    return _(pArray)
            .sort()
            .reduce(addToMakefileString, pStartWith + ":");
}

function thisFileOnly(pFile, pModDep){
    return pModDep.module === pFile;
}

function concatModDep (pModDeps, pFileDepArray, pModDep){
    return pFileDepArray
            .concat(pModDep)
            .concat(
                 pModDep.deplist.reduce(function(pDepSum, pFileDepArray){
                    return pDepSum.concat(extractFileDeps(pModDeps, pFileDepArray));
                 }, [])
            )<commit_msg>[src] renames a parameter so code is simpler to understand<commit_after>/*
 * generates
 * - all es6, amd and commonjs dependencies in the src tree
 */

var path  = require("path");
var madge = require("madge");
var utl   = require("./utl");
var fs    = require("fs");
var _     = require("lodash");

function sourcify (pBaseDir, pString){
    return path.join(
        pBaseDir, 
        pString + ".js"
    );
}

function addToMakefileString(pString, pAddition){
    return pString + " \\\n\t" + pAddition;
}

function getDepString(pArray, pStartWith){
    return _(pArray)
            .sort()
            .reduce(addToMakefileString, pStartWith + ":");
}

function thisFileOnly(pFile, pModDep){
    return pModDep.module === pFile;
}

function concatModDep (pModDeps, pFileDepArray, pModDep){
    return pFileDepArray
            .concat(pModDep)
            .concat(
                 pModDep.deplist.reduce(function(pDepSum, pListEntry){
                    return pDepSum.concat(extractFileDeps(pModDeps, pListEntry));
                 }, [])
            )
{'fraction_non_alphanumeric': 0.1257801248199712, 'fraction_numerical': 0.0009601536245799327, 'mean_word_length': 2.5684931506849313, 'pattern_counts': {'":': 2, '<': 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': '4278883', 'n_tokens_mistral': 675, 'n_tokens_neox': 660, 'n_words': 149}