function parseRoute(location) {
    const routes = {
        category: new Route("/r/categor(y)(ies)/:slug(/p/:page)"),
        tag: new Route("/r/tag(s)/:slug(/p/:page)"),
        post: new Route("/r/post(s)/:year/:month/:slug"),
        page: new Route("/r/page(s)/:slug"),
        postList: new Route("/r/(index)(/p/:page)"),
    };
    var matched;
    for (let key in routes) {
        matched = routes[key].match(location);
        if (matched) {
            matched.name = key;
            break;
        }
    }
    return matched;
}
/* parseRoute(location)
 *
 * Parse the given route and return the match object. The route matches here
 * are probably identical to the ones used by the application proper.
 *
 * The match object returned contains these properties:
 *
 *      name: the name of the widget the app will render for.
 *      slug: the slug for that thing.
 *      page: the page number or undefined.
 *      year: for posts.
 *      month: for posts.
 */
parseRoute(location)
Parse the given route and return the match object. The route matches here
are probably identical to the ones used by the application proper.

The match object returned contains these properties.

the name of the widget the app will render for.
slug: the slug for that thing.
page: the page number or undefined.
year: for posts.
month: for posts.
parseRoute ( location ) Parse the given route and return the match object . The route matches here are probably identical to the ones used by the application proper . The match object returned contains these properties . the name of the widget the app will render for . slug : the slug for that thing . page : the page number or undefined . year : for posts . month : for posts .
function parseRoute(location) {
    const routes = {
        category: new Route("/r/categor(y)(ies)/:slug(/p/:page)"),
        tag: new Route("/r/tag(s)/:slug(/p/:page)"),
        post: new Route("/r/post(s)/:year/:month/:slug"),
        page: new Route("/r/page(s)/:slug"),
        postList: new Route("/r/(index)(/p/:page)"),
    };
    var matched;
    for (let key in routes) {
        matched = routes[key].match(location);
        if (matched) {
            matched.name = key;
            break;
        }
    }
    return matched;
}
function parseRoute ( location ) { const routes = { category : new Route ( "/r/categor(y)(ies)/:slug(/p/:page)" ) , tag : new Route ( "/r/tag(s)/:slug(/p/:page)" ) , post : new Route ( "/r/post(s)/:year/:month/:slug" ) , page : new Route ( "/r/page(s)/:slug" ) , postList : new Route ( "/r/(index)(/p/:page)" ) , } ; var matched ; for ( let key in routes ) { matched = routes [ key ] . match ( location ) ; if ( matched ) { matched . name = key ; break ; } } return matched ; }
parseRoute(location)
 Parse the given route and return the match object.
parseRoute ( location ) Parse the given route and return the match object .