palin.js
function truncFilename(path, rootFolderName) {
    // bail if a string wasn't provided
    if (typeof path !== 'string') {
        return path;
    }

    var index = path.indexOf(rootFolderName);
    if (index > 0) {
        return path.substring(index + rootFolderName.length + 1);
    } else {
        return path;
    }
}
function truncFilename(path, rootFolderName) {
    // bail if a string wasn't provided
    if (typeof path !== 'string') {
        return path;
    }

    var index = path.indexOf(rootFolderName);
    if (index > 0) {
        return path.substring(index + rootFolderName.length + 1);
    } else {
        return path;
    }
}
function truncFilename ( path , rootFolderName ) { // bail if a string wasn't provided if ( typeof path !== 'string' ) { return path ; } var index = path . indexOf ( rootFolderName ) ; if ( index > 0 ) { return path . substring ( index + rootFolderName . length + 1 ) ; } else { return path ; } }
shortens the file name to exclude any path before the project folder name @param path: file path string. e.g. /home/mark/myproj/run.js @param rootFolderName: root folder for the project. e.g. "myproj" @return the shortened file path string
shortens the file name to exclude any path before the project folder name