lib/source.js
function removeSrcDirPrefixFromFile( srcDir, file ) {
    if ( typeof srcDir !== 'string' ) return file;
    if ( typeof file !== 'string' ) return file;

    if ( file.substr( 0, srcDir.length ) !== srcDir ) {
        return file;
    }
    return file.substr( srcDir.length );
}
function removeSrcDirPrefixFromFile( srcDir, file ) {
    if ( typeof srcDir !== 'string' ) return file;
    if ( typeof file !== 'string' ) return file;

    if ( file.substr( 0, srcDir.length ) !== srcDir ) {
        return file;
    }
    return file.substr( srcDir.length );
}
function removeSrcDirPrefixFromFile ( srcDir , file ) { if ( typeof srcDir !== 'string' ) return file ; if ( typeof file !== 'string' ) return file ; if ( file . substr ( 0 , srcDir . length ) !== srcDir ) { return file ; } return file . substr ( srcDir . length ) ; }
If present, remove the `srcDir` prefix of `file`.

@param   {[type]} srcDir [description]
@param   {[type]} file   [description]
@returns {[type]}        [description]

@example
const f = removeSrcDirPrefixFromFile;
f("/src/", "/myfile.cpp") === "/myfile.cpp";
f("/src/", "/src/myfile2.cpp") === "myfile2.cpp";
If present remove the srcDir prefix of file .