lib/functions/downloadDependencies.js
function processSource(code, dependencyList, depedencyName) {
    // Replace function declarations
    const packageName = dependencyList[depedencyName].packageName;
    code = code.replace(/(\s*)function\s([A-z]*)\s*\(*/g, `$1function ${packageName}_$2(`);

    // TODO replace function calls to dependencies
    const dependencies = dependencyList[depedencyName].dependencies;
    if (dependencies) {
        for (const dependency of Reflect.ownKeys(dependencies)) {
            const oldPrefix = dependencyList[dependency].packageName;
            console.log(oldPrefix);
            var re = new RegExp(`[ ]*${oldPrefix}_([A-z]*)[ ]*\\(`, "g");
            code = code.replace(re, ` ${dependency}_$1(`);
        }
    }
    return code;
}
function processSource(code, dependencyList, depedencyName) {
    // Replace function declarations
    const packageName = dependencyList[depedencyName].packageName;
    code = code.replace(/(\s*)function\s([A-z]*)\s*\(*/g, `$1function ${packageName}_$2(`);

    // TODO replace function calls to dependencies
    const dependencies = dependencyList[depedencyName].dependencies;
    if (dependencies) {
        for (const dependency of Reflect.ownKeys(dependencies)) {
            const oldPrefix = dependencyList[dependency].packageName;
            console.log(oldPrefix);
            var re = new RegExp(`[ ]*${oldPrefix}_([A-z]*)[ ]*\\(`, "g");
            code = code.replace(re, ` ${dependency}_$1(`);
        }
    }
    return code;
}
function processSource ( code , dependencyList , depedencyName ) { // Replace function declarations const packageName = dependencyList [ depedencyName ] . packageName ; code = code . replace ( / (\s*)function\s([A-z]*)\s*\(* / g , ` ${ packageName } ` ) ; // TODO replace function calls to dependencies const dependencies = dependencyList [ depedencyName ] . dependencies ; if ( dependencies ) { for ( const dependency of Reflect . ownKeys ( dependencies ) ) { const oldPrefix = dependencyList [ dependency ] . packageName ; console . log ( oldPrefix ) ; var re = new RegExp ( ` ${ oldPrefix } \\ ` , "g" ) ; code = code . replace ( re , ` ${ dependency } ` ) ; } } return code ; }
Process all function declarations and calls to use the libraries

@param {String} code - Code to process
@param {Object} dependencyList - all dependencies
@param {String} depedencyName - name of the dependency
@returns {String} Processed code
Process all function declarations and calls to use the libraries