mergeMetaLinks()function
mergeMetaLinks(current: MetaLinks | undefined, next: PossibleMetaLinks | undefined, url: ImmutableURL | undefined, root: ImmutableURL | undefined, caller: AnyCaller = mergeMetaLinks): MetaLinks | undefined
| Param | Type | |
|---|---|---|
current | MetaLinks | The existing resolved links. |
next | PossibleMetaLinks | The new (possibly relative) links to merge on top. |
url | ImmutableURL | The current page URL, used to resolve relative hrefs. |
.href | URLString | A URL string has a protocol and a //. required readonly |
.origin | URLString | A URL string has a protocol and a //. required readonly |
.pathname | AbsolutePath | Absolute path string starting with a / slash. required readonly |
root | ImmutableURL | The root URL, used to resolve absolute hrefs. |
.href | URLString | A URL string has a protocol and a //. required readonly |
.origin | URLString | A URL string has a protocol and a //. required readonly |
.pathname | AbsolutePath | Absolute path string starting with a / slash. required readonly |
caller | AnyCaller | 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).