MCPcopy Create free account
hub / github.com/cursor/cookbook / getFileActivityTargetText

Function getFileActivityTargetText

sdk/app-builder/src/components/app-builder.tsx:2490–2500  ·  view source on GitHub ↗
(
  content: string,
  verb: GroupableFileActivityVerb
)

Source from the content-addressed store, hash-verified

2488}
2489
2490function getFileActivityTargetText(
2491 content: string,
2492 verb: GroupableFileActivityVerb
2493) {
2494 const pattern = new RegExp(`^${verb}\\s+(.+)$`, "i")
2495 return stripActivityCount(content)
2496 .match(pattern)?.[1]
2497 ?.replace(/:\s*.*$/, "")
2498 .replace(/\s+\+\d+$/i, "")
2499 .trim()
2500}
2501
2502function getFileActivityTargetsFromTargetText(targetText: string) {
2503 const targets = targetText.split(/\s*,\s*/).filter(Boolean)

Callers 1

getGroupableFileActivityFunction · 0.85

Calls 1

stripActivityCountFunction · 0.85

Tested by

no test coverage detected