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

Function getCaptureNameSuggestion

integrations/clipper/src/api.ts:85–101  ·  view source on GitHub ↗
(
  target: CaptureTarget,
  payload: PageCapturePayload,
)

Source from the content-addressed store, hash-verified

83}
84
85export function getCaptureNameSuggestion(
86 target: CaptureTarget,
87 payload: PageCapturePayload,
88): string {
89 if (target === 'http') {
90 const url = findFirstUrl(payload.selectedText.trim()) ?? payload.url
91
92 return getHttpSuggestedName(url)
93 }
94
95 return (
96 payload.suggestedName
97 ?? payload.contextLabel
98 ?? payload.sourceTitle
99 ?? payload.pageTitle
100 )
101}
102
103export async function postCapture(
104 settings: ExtensionSettings,

Callers 1

updateCaptureNameFunction · 0.90

Calls 2

findFirstUrlFunction · 0.85
getHttpSuggestedNameFunction · 0.85

Tested by

no test coverage detected