diff --git a/src/Wes95/utils/url.ts b/src/Wes95/utils/url.ts index 270f6ae..0e86ecc 100644 --- a/src/Wes95/utils/url.ts +++ b/src/Wes95/utils/url.ts @@ -31,11 +31,11 @@ export const createURL = (urlString: string): URLObject => { throw new Error('Unable to infer hostname and pathname from pathname'); } - return { - ...urlToObject(url), - hostname: matches.groups.hostname, - pathname: matches.groups.pathname, - }; + const urlObject = urlToObject(url); + urlObject.hostname = matches.groups.hostname; + urlObject.pathname = matches.groups.pathname; + + return urlObject; }; export function getRealPublicURL(path: string | undefined) {