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

Function first

packages/ui/src/components/avatar.tsx:8–12  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

6 : undefined
7
8function first(value: string) {
9 if (!value) return ""
10 if (!segmenter) return Array.from(value)[0] ?? ""
11 return segmenter.segment(value)[Symbol.iterator]().next().value?.segment ?? Array.from(value)[0] ?? ""
12}
13
14export interface AvatarProps extends ComponentProps<"div"> {
15 fallback: string

Callers 2

AvatarFunction · 0.70
refcount.test.tsFile · 0.50

Calls 2

fromMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected