pather.js
function getFilePath(basePath, relativePath) {
        var count = 0,
            array1, array2;
        for (var i = 0, length = relativePath.length; i < length; i++) {
            if (relativePath[i] == '..') {
                count++;
            }
        }
        array1 = basePath.slice(0, basePath.length - 1 - count);
        array2 = relativePath.slice(count);
        return array1.concat(array2);
    }
function getFilePath(basePath, relativePath) {
        var count = 0,
            array1, array2;
        for (var i = 0, length = relativePath.length; i < length; i++) {
            if (relativePath[i] == '..') {
                count++;
            }
        }
        array1 = basePath.slice(0, basePath.length - 1 - count);
        array2 = relativePath.slice(count);
        return array1.concat(array2);
    }
function getFilePath ( basePath , relativePath ) { var count = 0 , array1 , array2 ; for ( var i = 0 , length = relativePath . length ; i < length ; i ++ ) { if ( relativePath [ i ] == '..' ) { count ++ ; } } array1 = basePath . slice ( 0 , basePath . length - 1 - count ) ; array2 = relativePath . slice ( count ) ; return array1 . concat ( array2 ) ; }
get relative file path basing on its containing file path and its relative path
@param {String} basePath containing file path
@param {String} relative path
get relative file path basing on its containing file path and its relative path