build/web/c0.js
function injectParams(pattern, params) {
    params = params || {};

    var splatIndex = 0;

    return pattern.replace(paramInjectMatcher, function (match, paramName) {
      paramName = paramName || 'splat';

      // If param is optional don't check for existence
      if (paramName.slice(-1) === '?') {
        paramName = paramName.slice(0, -1);

        if (params[paramName] == null) return '';
      } else {
        invariant(params[paramName] != null, 'Missing "%s" parameter for path "%s"', paramName, pattern);
      }

      var segment;
      if (paramName === 'splat' && Array.isArray(params[paramName])) {
        segment = params[paramName][splatIndex++];

        invariant(segment != null, 'Missing splat # %s for path "%s"', splatIndex, pattern);
      } else {
        segment = params[paramName];
      }

      return segment;
    }).replace(paramInjectTrailingSlashMatcher, '/');
  }
function injectParams(pattern, params) {
    params = params || {};

    var splatIndex = 0;

    return pattern.replace(paramInjectMatcher, function (match, paramName) {
      paramName = paramName || 'splat';

      // If param is optional don't check for existence
      if (paramName.slice(-1) === '?') {
        paramName = paramName.slice(0, -1);

        if (params[paramName] == null) return '';
      } else {
        invariant(params[paramName] != null, 'Missing "%s" parameter for path "%s"', paramName, pattern);
      }

      var segment;
      if (paramName === 'splat' && Array.isArray(params[paramName])) {
        segment = params[paramName][splatIndex++];

        invariant(segment != null, 'Missing splat # %s for path "%s"', splatIndex, pattern);
      } else {
        segment = params[paramName];
      }

      return segment;
    }).replace(paramInjectTrailingSlashMatcher, '/');
  }
function injectParams ( pattern , params ) { params = params || { } ; var splatIndex = 0 ; return pattern . replace ( paramInjectMatcher , function ( match , paramName ) { paramName = paramName || 'splat' ; // If param is optional don't check for existence if ( paramName . slice ( - 1 ) === '?' ) { paramName = paramName . slice ( 0 , - 1 ) ; if ( params [ paramName ] == null ) return '' ; } else { invariant ( params [ paramName ] != null , 'Missing "%s" parameter for path "%s"' , paramName , pattern ) ; } var segment ; if ( paramName === 'splat' && Array . isArray ( params [ paramName ] ) ) { segment = params [ paramName ] [ splatIndex ++ ] ; invariant ( segment != null , 'Missing splat # %s for path "%s"' , splatIndex , pattern ) ; } else { segment = params [ paramName ] ; } return segment ; } ) . replace ( paramInjectTrailingSlashMatcher , '/' ) ; }
Returns a version of the given route path with params interpolated. Throws
if there is a dynamic segment of the route path for which there is no param.
Returns a version of the given route path with params interpolated . Throws if there is a dynamic segment of the route path for which there is no param .