(bytes: number)
| 35 | const maxFrameBytes = options.maxFrameBytes ?? Number.POSITIVE_INFINITY |
| 36 | |
| 37 | const rejectOversizedFrame = (bytes: number): void => { |
| 38 | const error = new Error( |
| 39 | `NDJSON frame exceeded ${maxFrameBytes} bytes (${bytes})`, |
| 40 | ) |
| 41 | options.onFrameError?.(error) |
| 42 | if (options.destroyOnFrameError ?? true) { |
| 43 | socket.destroy(error) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | const rejectInvalidFrame = (error: unknown): void => { |
| 48 | const frameError = |
no test coverage detected