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

Function common

packages/session-ui/src/components/tool-count-label.tsx:14–24  ·  view source on GitHub ↗
(one: string, other: string)

Source from the content-addressed store, hash-verified

12}
13
14function common(one: string, other: string) {
15 const a = Array.from(one)
16 const b = Array.from(other)
17 let i = 0
18 while (i < a.length && i < b.length && a[i] === b[i]) i++
19 return {
20 stem: a.slice(0, i).join(""),
21 one: a.slice(i).join(""),
22 other: b.slice(i).join(""),
23 }
24}
25
26export function AnimatedCountLabel(props: { count: number; one: string; other: string; class?: string }) {
27 const one = createMemo(() => split(props.one))

Callers 1

AnimatedCountLabelFunction · 0.70

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected