MCPcopy Index your code
hub / github.com/anomalyco/opencode / split

Function split

packages/opencode/src/cli/cmd/run/demo.ts:245–252  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

243}
244
245function split(text: string): string[] {
246 if (text.length <= 48) {
247 return [text]
248 }
249
250 const size = Math.ceil(text.length / 3)
251 return [text.slice(0, size), text.slice(size, size * 2), text.slice(size * 2)]
252}
253
254function take(state: State, key: "msg" | "part" | "call" | "perm" | "ask", prefix: string): string {
255 state[key] += 1

Callers 2

emitTextFunction · 0.70
emitReasoningFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected