MCPcopy Create free account
hub / github.com/anomalyco/opencode / text

Function text

packages/session-ui/src/components/file.tsx:710–717  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

708 const [local, others] = splitProps(props, textKeys)
709
710 const text = () => {
711 const value = local.file.contents as unknown
712 if (typeof value === "string") return value
713 if (Array.isArray(value)) return value.join("\n")
714 if (value == null) return ""
715 // oxlint-disable-next-line no-base-to-string -- file contents cast to unknown, coercion is intentional
716 return String(value)
717 }
718
719 const lineCount = () => {
720 const value = text()

Callers 2

lineCountFunction · 0.70
TextViewerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected