src/basis/router.js
function get(params){
    var path = params.path;
    var config = params.config;

    if (path instanceof Route)
      return path;

    var route;
    // If there is no config specified - it should be a plain route, so we try to reuse it
    if (!config)
      route = plainRoutesByPath[path];

    if (!route && params.autocreate)
    {
      var parseInfo = Object.prototype.toString.call(path) == '[object RegExp]'
        ? { path: path, regexp: path, ast: null, params: [] }
        : parsePath(path);
      route = createRoute(parseInfo, config);
      allRoutes.push(route);

      if (route instanceof ParametrizedRoute == false)
        plainRoutesByPath[path] = route;

      if (typeof currentPath == 'string')
      {
        var flags = route.processLocation_(currentPath);

        if (flags & ROUTE_ENTER)
          routeEnter(route);
        if (flags & ROUTE_MATCH)
          routeMatch(route);
      }
    }

    return route;
  }
function get(params){
    var path = params.path;
    var config = params.config;

    if (path instanceof Route)
      return path;

    var route;
    // If there is no config specified - it should be a plain route, so we try to reuse it
    if (!config)
      route = plainRoutesByPath[path];

    if (!route && params.autocreate)
    {
      var parseInfo = Object.prototype.toString.call(path) == '[object RegExp]'
        ? { path: path, regexp: path, ast: null, params: [] }
        : parsePath(path);
      route = createRoute(parseInfo, config);
      allRoutes.push(route);

      if (route instanceof ParametrizedRoute == false)
        plainRoutesByPath[path] = route;

      if (typeof currentPath == 'string')
      {
        var flags = route.processLocation_(currentPath);

        if (flags & ROUTE_ENTER)
          routeEnter(route);
        if (flags & ROUTE_MATCH)
          routeMatch(route);
      }
    }

    return route;
  }
function get ( params ) { var path = params . path ; var config = params . config ; if ( path instanceof Route ) return path ; var route ; // If there is no config specified - it should be a plain route, so we try to reuse it if ( ! config ) route = plainRoutesByPath [ path ] ; if ( ! route && params . autocreate ) { var parseInfo = Object . prototype . toString . call ( path ) == '[object RegExp]' ? { path : path , regexp : path , ast : null , params : [ ] } : parsePath ( path ) ; route = createRoute ( parseInfo , config ) ; allRoutes . push ( route ) ; if ( route instanceof ParametrizedRoute == false ) plainRoutesByPath [ path ] = route ; if ( typeof currentPath == 'string' ) { var flags = route . processLocation_ ( currentPath ) ; if ( flags & ROUTE_ENTER ) routeEnter ( route ) ; if ( flags & ROUTE_MATCH ) routeMatch ( route ) ; } } return route ; }
Returns route descriptor
Returns route descriptor