(
size: FileSystem.SizeInput,
options?: {
readonly bytesToRead?: FileSystem.SizeInput | undefined
readonly offset?: FileSystem.SizeInput | undefined
}
)
| 485 | ): Stream => new Stream(body, contentType ?? "application/octet-stream", contentLength) |
| 486 | |
| 487 | const fileContentLength = ( |
| 488 | size: FileSystem.SizeInput, |
| 489 | options?: { |
| 490 | readonly bytesToRead?: FileSystem.SizeInput | undefined |
| 491 | readonly offset?: FileSystem.SizeInput | undefined |
| 492 | } |
| 493 | ): number => { |
| 494 | const available = Math.max(0, Number(size) - Number(options?.offset ?? 0)) |
| 495 | return options?.bytesToRead === undefined |
| 496 | ? available |
| 497 | : Math.min(available, Math.max(0, Number(options.bytesToRead))) |
| 498 | } |
| 499 | |
| 500 | /** |
| 501 | * Creates a streaming HTTP body for a file path. |
no test coverage detected