1 parent 7c7c8e7 commit f3ece18Copy full SHA for f3ece18
1 file changed
src/createSourceInfo.ts
@@ -18,17 +18,9 @@ function createFileSystemSourceInfo(file: File): SourceInfo {
18
source: new StreamSource({
19
getSize: () => fileSize,
20
read: (start, end) => {
21
- const readStart = Math.max(0, Math.min(start, fileSize));
22
- const readEnd = Math.max(readStart, Math.min(end, fileSize));
23
- const length = readEnd - readStart;
24
-
25
- if (length === 0) {
26
- return new Uint8Array();
27
- }
28
29
const currentHandle = getHandle();
30
- currentHandle.offset = readStart;
31
- return currentHandle.readBytes(length);
+ currentHandle.offset = start;
+ return currentHandle.readBytes(end - start);
32
},
33
dispose: () => {
34
handle?.close();
0 commit comments