mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add support for relative urls
This commit is contained in:
parent
0accd4c73e
commit
abbdd9cf2b
1 changed files with 1 additions and 1 deletions
|
|
@ -41,7 +41,7 @@ export function getSiteUrl () {
|
||||||
export function getPartPartsFromUrl ( urlString ) {
|
export function getPartPartsFromUrl ( urlString ) {
|
||||||
if ( typeof urlString !== 'string' ) throw new Error('urlString must be a string')
|
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
|
const pathParts = url.pathname
|
||||||
.replace(/^\/+/, '') // Trim slashes from the beginning
|
.replace(/^\/+/, '') // Trim slashes from the beginning
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue