scripts/routes/route-map.js
function _normalizePath(path, parent, ancestors) {
    if (path === '/') {
        return path;
    }

    path = path.replace(/\/$/, '');

    // If path begins with / then assume it is independent route
    if (path[0] === '/') {
        return path;
    }

    // If no parent, and route doesn't start with /, then prepend /
    if (! parent) {
        return `/${path}`;
    }

    if (ancestors) {
        return _cleanPath(`${ancestors.join('/')}/${path}`);
    }

    return _cleanPath(`${parent.path}/${path}`);
}
function _normalizePath(path, parent, ancestors) {
    if (path === '/') {
        return path;
    }

    path = path.replace(/\/$/, '');

    // If path begins with / then assume it is independent route
    if (path[0] === '/') {
        return path;
    }

    // If no parent, and route doesn't start with /, then prepend /
    if (! parent) {
        return `/${path}`;
    }

    if (ancestors) {
        return _cleanPath(`${ancestors.join('/')}/${path}`);
    }

    return _cleanPath(`${parent.path}/${path}`);
}
function _normalizePath ( path , parent , ancestors ) { if ( path === '/' ) { return path ; } path = path . replace ( / \/$ / , '' ) ; // If path begins with / then assume it is independent route if ( path [ 0 ] === '/' ) { return path ; } // If no parent, and route doesn't start with /, then prepend / if ( ! parent ) { return ` ${ path } ` ; } if ( ancestors ) { return _cleanPath ( ` ${ ancestors . join ( '/' ) } ${ path } ` ) ; } return _cleanPath ( ` ${ parent . path } ${ path } ` ) ; }
Find full path of route

@param {string} path
@param {Object} [parent]
@returns {*}
@private
Find full path of route