(content: string)
| 288 | } |
| 289 | |
| 290 | private validateContent(content: string): void { |
| 291 | const size = Buffer.byteLength(content, 'utf8') |
| 292 | if (size > MEMORY.MAX_MESSAGE_CONTENT_BYTES) { |
| 293 | throw new Error( |
| 294 | `Message content too large (${size} bytes, max ${MEMORY.MAX_MESSAGE_CONTENT_BYTES})` |
| 295 | ) |
| 296 | } |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | export const memoryService = new Memory() |
no outgoing calls
no test coverage detected