(buffer: Buffer)
| 332 | * Validate that a buffer contains valid PNG data by checking magic bytes |
| 333 | */ |
| 334 | export function isValidPng(buffer: Buffer): boolean { |
| 335 | return buffer.length >= 8 && buffer.subarray(0, 8).equals(PNG_MAGIC_BYTES) |
| 336 | } |
| 337 | |
| 338 | /** |
| 339 | * Detect a renderable raster image from its leading bytes, returning the canonical MIME type or |
no outgoing calls
no test coverage detected