mergeMetaAssets()function

mergeMetaAssets(current: MetaAssets | undefined, next: PossibleMetaAssets | undefined, url: ImmutableURL | undefined, root: ImmutableURL | undefined, caller: AnyCaller = mergeMetaAssets): MetaAssets | undefined
ParamType
currentMetaAssets
The existing resolved assets.
nextPossibleMetaAssets
The new (possibly relative) assets to append.
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 mergeMetaAssets). Defaults to mergeMetaAssets
Return
MetaAssets | undefined
The combined resolved asset list, or undefined if there was nothing to merge.

Merge two meta asset lists (modules, scripts, stylesheets), resolving the new hrefs to absolute URIs.

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