MCPcopy
hub / github.com/apify/crawlee / tryAbsoluteURL

Function tryAbsoluteURL

packages/utils/src/internals/extract-urls.ts:96–102  ·  view source on GitHub ↗
(href: string, baseUrl: string)

Source from the content-addressed store, hash-verified

94 * Helper function used to validate URLs used when extracting URLs from a page
95 */
96export function tryAbsoluteURL(href: string, baseUrl: string): string | undefined {
97 try {
98 return new URL(href, baseUrl).href;
99 } catch {
100 return undefined;
101 }
102}

Callers 4

extractUrlsFromCheerioFunction · 0.90
extractUrlsFromPageFunction · 0.85
extractUrlsFromWindowFunction · 0.85
extractUrlsFromWindowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…