MCPcopy Create free account
hub / github.com/ThatGuySam/doesitarm / getPathPartsFromAstroRequest

Function getPathPartsFromAstroRequest

helpers/url.js:74–92  ·  view source on GitHub ↗
( AstroRequest )

Source from the content-addressed store, hash-verified

72}
73
74export function getPathPartsFromAstroRequest ( AstroRequest ) {
75 // Parse the request url
76
77 const url = new URL( AstroRequest.url, 'https://doesitarm.com' )
78
79 const [
80 routeType,
81 pathSlug,
82 subSlug
83 ] = getPartPartsFromUrl ( AstroRequest.url )
84
85 return {
86 pathname: url.pathname,
87 routeType,
88 pathSlug,
89 subSlug,
90 params: Object.fromEntries( url.searchParams )
91 }
92}

Callers

nothing calls this directly

Calls 1

getPartPartsFromUrlFunction · 0.85

Tested by

no test coverage detected