slice buff to bytesRead size

This commit is contained in:
Abhinav 2022-09-07 20:34:08 +05:30
parent 764a3aa415
commit d9a37ffd71

View file

@ -42,7 +42,7 @@ export const getFileStream = async (filePath: string) => {
controller.close(); controller.close();
await fs.close(file); await fs.close(file);
} else { } else {
controller.enqueue(buff); controller.enqueue(buff.slice(0, bytesRead));
} }
} catch (e) { } catch (e) {
await fs.close(file); await fs.close(file);