MCPcopy Create free account
hub / github.com/cloudflare/computer / utf8ByteLength

Function utf8ByteLength

packages/computer/src/tools/fs/read.ts:53–55  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

51// workers runtimes.
52const _enc = new TextEncoder();
53function utf8ByteLength(s: string): number {
54 return _enc.encode(s).length;
55}
56export function createReadTool(options: ReadToolOptions): Tool<z.infer<typeof inputSchema>> {
57 const { store } = options;
58 const maxLines = options.maxLines ?? DEFAULT_MAX_LINES;

Callers 1

processLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected