Skip to content

collectExternalTargets

Collects every unique external URL referenced across the built pages, deduplicated.

Only HTTP(S) links that are not isInternalDocUrl are returned. Each unique URL maps to the first page that referenced it, so a later failure can be reported with a concrete example page even though the URL is fetched only once.

Import:

import { collectExternalTargets } from '@mnaoumov/typescript-dev-toolkit/docs-site/link-check';

Signature:

function collectExternalTargets(pages: DocumentationPage[], siteBaseUrl: string): Map<string, string>

Parameters:

Parameter Type Description
pages DocumentationPage[] The built documentation pages to scan.
siteBaseUrl string The absolute base URL the site is served from (with a trailing slash).

Returns: Map<string, string> — A map from each unique external URL to one referencing page URL.


Links to this page: