MCPcopy Index your code
hub / github.com/massCodeIO/massCode / getSourceParts

Function getSourceParts

integrations/clipper/src/popup.ts:331–349  ·  view source on GitHub ↗
(payload: PageCapturePayload)

Source from the content-addressed store, hash-verified

329}
330
331function getSourceParts(payload: PageCapturePayload): {
332 path: string
333 title: string
334} {
335 try {
336 const url = new URL(payload.sourceUrl)
337
338 return {
339 path: payload.contextLabel ?? (url.pathname || '/'),
340 title: url.hostname.replace(/^www\./, ''),
341 }
342 }
343 catch {
344 return {
345 path: payload.contextLabel ?? payload.sourceUrl,
346 title: payload.sourceTitle || 'Current page',
347 }
348 }
349}
350
351function updateSourceIcon(faviconUrl?: string): void {
352 if (!sourceMark) {

Callers 1

updateSourceRowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected