Skip to content

Commit

Permalink
lint(UrlMatcher): Fix TS lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Feb 14, 2016
1 parent 86e07ef commit e441a7c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/url/urlMatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,18 +418,19 @@ export class UrlMatcher {
return acc + encodeURIComponent(<string> encoded);
}, "");

// Build the query string by
// Build the query string by applying parameter values (array or regular)
// then mapping to key=value, then flattening and joining using "&"
let queryString = queryParams.map((param: Param) => {
let {squash, encoded, isDefaultValue} = getDetails(param);
if (encoded == null || (isDefaultValue && squash !== false)) return;
if (!isArray(encoded)) encoded = [<string> encoded];
if (encoded.length === 0) return;
if (!param.type.raw) encoded = map(<string[]> encoded, encodeURIComponent);

return encoded.map(val => `${param.id}=${val}`);
return (<string[]> encoded).map(val => `${param.id}=${val}`);
}).filter(identity).reduce(unnestR, []).join("&");

// Concat the pathstring with the queryString (if exists) and the hasString (if exists)
// Concat the pathstring with the queryString (if exists) and the hashString (if exists)
return pathString + (queryString ? `?${queryString}` : "") + (values["#"] ? "#" + values["#"] : "");
}

Expand Down

0 comments on commit e441a7c

Please sign in to comment.