Skip to content

Commit

Permalink
fix(hash-stream-node): disable createReadStream with file descriptor (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Feb 25, 2022
1 parent 2eb483f commit e5e89d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/hash-stream-node/src/fsCreateReadStream.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jest.setTimeout(30000);
describe(fsCreateReadStream.name, () => {
const mockFileContents = fs.readFileSync(__filename, "utf8");

it("uses file descriptor if defined", (done) => {
it.skip("uses file descriptor if defined", (done) => {
fs.promises.open(__filename, "r").then((fd) => {
if ((fd as any).createReadStream) {
const readStream = (fd as any).createReadStream();
Expand Down
3 changes: 2 additions & 1 deletion packages/hash-stream-node/src/fsCreateReadStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { createReadStream, ReadStream } from "fs";

export const fsCreateReadStream = (readStream: ReadStream) =>
createReadStream(readStream.path, {
fd: (readStream as any).fd,
// ToDo: Removed to fix https://github.com/aws/aws-sdk-js-v3/issues/3368
// fd: (readStream as any).fd,
start: (readStream as any).start,
end: (readStream as any).end,
});

0 comments on commit e5e89d2

Please sign in to comment.