Add support for relative urls

This commit is contained in:
Sam Carlton 2022-05-06 18:25:39 -05:00
parent 0accd4c73e
commit abbdd9cf2b

View file

@ -41,7 +41,7 @@ export function getSiteUrl () {
export function getPartPartsFromUrl ( urlString ) {
if ( typeof urlString !== 'string' ) throw new Error('urlString must be a string')
const url = new URL( urlString )
const url = new URL( urlString, 'https://doesitarm.com' )
const pathParts = url.pathname
.replace(/^\/+/, '') // Trim slashes from the beginning