createMeta()function

createMeta(meta: PossibleMeta, caller: AnyCaller = createMeta): Meta
ParamType
metaPossibleMeta
The input PossibleMeta to resolve. required
    .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 URL-resolution errors to (defaults to createMeta). Defaults to createMeta
Return
Meta
A new fully-resolved Meta.

Create a fully-formed Meta from a PossibleMeta.

  • Like mergeMeta() but with no previous Meta to merge into — initialises meta from scratch.

Examples

createMeta({ app: "Manchester Runners", url: "https://run.com" })