(content: string, maxBytes?: number)
| 412 | } |
| 413 | |
| 414 | function assertParsedContentWithinLimit(content: string, maxBytes?: number): string { |
| 415 | if (maxBytes !== undefined) { |
| 416 | assertKnownSizeWithinLimit(Buffer.byteLength(content, 'utf8'), maxBytes, 'parsed file output') |
| 417 | } |
| 418 | return content |
| 419 | } |
| 420 | |
| 421 | /** |
| 422 | * Validate file path for security - prevents null byte injection and path traversal attacks. |
no test coverage detected