MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / normalizeURL

Function normalizeURL

packages/components/src/utils.ts:420–429  ·  view source on GitHub ↗

* Normalize URL to prevent crawling the same page * @param {string} urlString * @returns {string}

(urlString: string)

Source from the content-addressed store, hash-verified

418 * @returns {string}
419 */
420function normalizeURL(urlString: string): string {
421 const urlObj = new URL(urlString)
422 const port = urlObj.port ? `:${urlObj.port}` : ''
423 const hostPath = urlObj.hostname + port + urlObj.pathname + urlObj.search
424 if (hostPath.length > 0 && hostPath.slice(-1) == '/') {
425 // handling trailing slash
426 return hostPath.slice(0, -1)
427 }
428 return hostPath
429}
430
431/**
432 * Recursive crawl using normalizeURL and getURLsFromHTML

Callers 1

crawlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected