Skip to content

Commit

Permalink
fix: url port returning null instead of an empty string
Browse files Browse the repository at this point in the history
defaulted urlMount parameter to an empty string
  • Loading branch information
Michael committed Oct 21, 2022
1 parent d108cce commit c046b23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/core/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ export function isValidURL(url: string): boolean {

export function convertStringToURIComponent(
input: string,
urlMount?: string
urlMount: string = ""
): URIComponent {
const url = new URL(input);

const protocol = stringReplacer(url.protocol, ":", "") as URLProtocol;
const port = url.port ? parseInt(url.port) : null;
const port = url.port ? parseInt(url.port) : "";
const pathname = stringReplacer(url.pathname, urlMount, "");

return {
Expand Down

0 comments on commit c046b23

Please sign in to comment.