docs: 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, '/');
    }