(content: string)
| 1159 | } |
| 1160 | |
| 1161 | function 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 | |
| 1170 | function countOccurrences(content: string, needle: string): number { |
| 1171 | let count = 0; |
no outgoing calls
no test coverage detected