requireMetaURL()function
requireMetaURL(meta?: PossibleMeta, caller: AnyCaller = requireMetaURL): MetaURL
| Param | Type | |
|---|---|---|
meta | PossibleMeta | A set of new possible meta data to combine into the current meta context. |
.root | PossibleURL | |
.url | PossibleURI | |
.params | PossibleURIParams | Set the params in the URL (not merged with existing params). - Added to url after it is resolved.- Baseically readonly |
.links | PossibleMetaLinks | Set of input meta <link /> tags in { rel: href } format, before hrefs are resolved. readonly |
.modules | PossibleMetaAssets | Set of input linked assets in (href)[] format, before hrefs are resolved. readonly |
.scripts | PossibleMetaAssets | Set of input linked assets in (href)[] format, before hrefs are resolved. readonly |
.stylesheets | PossibleMetaAssets | Set of input linked assets in (href)[] format, before hrefs are resolved. readonly |
caller | AnyCaller | Function to attribute thrown RequiredErrors to (defaults to requireMetaURL). Defaults to requireMetaURL |
| 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();