MCPcopy Index your code
hub / github.com/coder/mux / assertWithinFileSizeCap

Function assertWithinFileSizeCap

src/node/services/memoryService.ts:1161–1168  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

1159}
1160
1161function assertWithinFileSizeCap(content: string): void {
1162 const bytes = Buffer.byteLength(content, "utf-8");
1163 if (bytes > MEMORY_MAX_FILE_BYTES) {
1164 throw new MemoryCommandError(
1165 `Memory files are limited to ${MEMORY_MAX_FILE_BYTES} bytes (got ${bytes}); split the content into smaller files`
1166 );
1167 }
1168}
1169
1170function countOccurrences(content: string, needle: string): number {
1171 let count = 0;

Callers 4

createMethod · 0.85
strReplaceMethod · 0.85
insertMethod · 0.85
saveFileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected