mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Return object for getPathPartsFromAstroRequest
This commit is contained in:
parent
5dbbca4610
commit
5d6e4954da
3 changed files with 23 additions and 8 deletions
|
|
@ -74,5 +74,18 @@ export function getPartPartsFromUrl ( urlString ) {
|
|||
export function getPathPartsFromAstroRequest ( AstroRequest ) {
|
||||
// Parse the request url
|
||||
|
||||
return getPartPartsFromUrl ( AstroRequest.url )
|
||||
const url = new URL( AstroRequest.url, 'https://doesitarm.com' )
|
||||
|
||||
const [
|
||||
routeType,
|
||||
pathSlug,
|
||||
subSlug = null
|
||||
] = getPartPartsFromUrl ( AstroRequest.url )
|
||||
|
||||
return {
|
||||
pathname: url.pathname,
|
||||
routeType,
|
||||
pathSlug,
|
||||
subSlug
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue