Skip to content

Commit 15ff5a0

Browse files
Fix S3 object read (#192)
1 parent 4d8ffc2 commit 15ff5a0

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

CHANGELOG.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
* JSON.stringify bugfix for custom objects with `toJSON()` method
2-
* Increase WHATWG/WinterCG `Fetch` compatibility:
3-
* Add `Blob`
4-
* Make `Request` and `Response` instantiable from global scope
5-
* Add missing properties
6-
* Update dependencies
7-
* Minor bugfixes
1+
* Fix S3 Object Read

shims/sdk-stream-mixin.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ const transformToWebStream = () => {
77
};
88

99
async function transformToByteArray() {
10-
return this;
10+
return await this.typedArray();
1111
}
1212

1313
async function transformToString(encoding) {
14+
const typedArray = await this.typedArray();
1415
if (encoding === "base64") {
15-
return toBase64(this);
16+
return toBase64(typedArray);
1617
} else if (encoding === "hex") {
17-
return toHex(this);
18+
return toHex(typedArray);
1819
}
19-
return toUtf8(this);
20+
return toUtf8(typedArray);
2021
}
2122

2223
export const sdkStreamMixin = (stream) =>

0 commit comments

Comments
 (0)