function isInRoot(root, filename) {
    root = path.normalize(root);
    filename = path.normalize(filename);

    if (root === '.') {
        return true;
    }
    if (root[root.length - 1] != path.sep) {
        root = root + path.sep;
    }

    return (filename.substr(0, root.length) === root);
}
function isInRoot(root, filename) {
    root = path.normalize(root);
    filename = path.normalize(filename);

    if (root === '.') {
        return true;
    }
    if (root[root.length - 1] != path.sep) {
        root = root + path.sep;
    }

    return (filename.substr(0, root.length) === root);
}
function isInRoot ( root , filename ) { root = path . normalize ( root ) ; filename = path . normalize ( filename ) ; if ( root === '.' ) { return true ; } if ( root [ root . length - 1 ] != path . sep ) { root = root + path . sep ; } return ( filename . substr ( 0 , root . length ) === root ) ; }
Return true if file path is inside a folder
Return true if file path is inside a folder
Check if the filename is in the root directory