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(). Defaults to the origin of url when unset. 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 and root, plus path and params properties combined in.
Throws
unknown
RequiredError If the current meta has no url or no root.
unknown
RequiredError If the current meta url and root do not share a root (different origin, or url outside root's path).

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

Examples

const { path, params } = requireMetaURL();