All files / transform/helper generateFunctionMangle.js

83.33% Statements 5/6
50% Branches 1/2
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19                    3x   3x 1x 1x     3x  
/**
 * Given a function's data, the outputs a mangled identifier which will uniquely
 * describe and reference its signature
 * 
 * @param {string} rootName - The root name or primary name of the function.
 *     e.g. in `foo(bar: baz)`, it would be `foo`
 * @param {string[][]} params - A [[name, type]] arrary where `name` and `type`
 *     are strings. type should be determined by `generateTypeMangle`.
 */
export default function generateFunctionMangle(rootName: string, params: string[][]) {
    var paramList = "";
    
    for (var i = 0; i < params.length; i++) {
        Iif (i > 0) paramList += ",";
        paramList += params[i][0] + ":" + params[i][1];
    }
    
    return rootName + "(" + paramList  + ")";
}