mergeMetaLinks()function

mergeMetaLinks(current: MetaLinks | undefined, next: PossibleMetaLinks | undefined, url: ImmutableURL | undefined, root: ImmutableURL | undefined, caller: AnyCaller = mergeMetaLinks): MetaLinks | undefined
ParamType
currentMetaLinks
The existing resolved links.
nextPossibleMetaLinks
The new (possibly relative) links to merge on top.
urlImmutableURL
The current page URL, used to resolve relative hrefs.
    .hrefURLString
A URL string has a protocol and a //. required readonly
    .originURLString
A URL string has a protocol and a //. required readonly
    .pathnameAbsolutePath
Absolute path string starting with a / slash. required readonly
rootImmutableURL
The root URL, used to resolve absolute hrefs.
    .hrefURLString
A URL string has a protocol and a //. required readonly
    .originURLString
A URL string has a protocol and a //. required readonly
    .pathnameAbsolutePath
Absolute path string starting with a / slash. required readonly
callerAnyCaller
Function to attribute thrown URL-resolution errors to (defaults to mergeMetaLinks). Defaults to mergeMetaLinks
Return
MetaLinks | undefined
The merged resolved links, or undefined if there was nothing to merge.

Merge two meta <link> lists, resolving the new hrefs to absolute URIs.

  • New links are resolved relative to current URL (relative paths) and root URL (absolute paths).