requireMetaURL()function

requireMetaURL(meta?: PossibleMeta, caller: AnyCaller = requireMetaURL): MetaURL
ParamType
metaPossibleMeta
A set of new possible meta data to combine into the current meta context.
    .rootPossibleURL
Base URL for the app — accepts a string or URL, resolved with requireURL(). readonly
    .urlPossibleURI
New URL for the page.
- Resolved using requireURL() if set relative to root readonly
    .paramsPossibleURIParams
Set the params in the URL (not merged with existing params).
- Added to url after it is resolved.
- Baseically readonly
    .linksPossibleMetaLinks
Set of input meta <link /> tags in { rel: href } format, before hrefs are resolved. readonly
    .modulesPossibleMetaAssets
Set of input linked assets in (href)[] format, before hrefs are resolved. readonly
    .scriptsPossibleMetaAssets
Set of input linked assets in (href)[] format, before hrefs are resolved. readonly
    .stylesheetsPossibleMetaAssets
Set of input linked assets in (href)[] format, before hrefs are resolved. readonly
callerAnyCaller
Function to attribute thrown RequiredErrors to (defaults to requireMetaURL). Defaults to requireMetaURL
Return
MetaURL
A Meta object with a defined url, plus path and params properties combined in.
Throws
unknown
RequiredError If the current meta has no url.
unknown
RequiredError If the current meta url does not share an origin with the meta root.

Read the current Meta context and derive URL helpers (path and params) from its url.

Examples

const { path, params } = requireMetaURL();