Skip to content

Commit

Permalink
refactor: use a performant alternative to build the '/' route
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Nov 22, 2023
1 parent a0e8f15 commit c9d3445
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/router/lookup_store/url_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ export class UrlBuilder {
* we must break out from the loop
*/
if (token.type === 0) {
const value = token.val.startsWith('/') ? token.val.substring(1) : token.val
uriSegments.push(`${value}${token.end}`)
uriSegments.push(token.val === '/' ? '' : `${token.val}${token.end}`)
} else if (token.type === 2) {
const values: string[] = paramsArray ? paramsArray.slice(paramsIndex) : paramsObject['*']
this.#ensureHasWildCardValues(pattern, values)
Expand Down

0 comments on commit c9d3445

Please sign in to comment.