@quatrain/storage-s3 1.2.7 → 1.2.8-pr25.8691
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/S3StorageAdapter.js
CHANGED
|
@@ -72,7 +72,14 @@ class S3StorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
72
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
73
|
return new Promise((resolve, reject) => {
|
|
74
74
|
const _buf = [];
|
|
75
|
-
stream.on('data', (chunk) =>
|
|
75
|
+
stream.on('data', (chunk) => {
|
|
76
|
+
if (typeof chunk === 'string') {
|
|
77
|
+
_buf.push(Buffer.from(chunk, 'utf-8'));
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
_buf.push(Buffer.from(chunk));
|
|
81
|
+
}
|
|
82
|
+
});
|
|
76
83
|
stream.on('end', () => resolve(Buffer.concat(_buf)));
|
|
77
84
|
stream.on('error', (err) => reject(err));
|
|
78
85
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/storage-s3",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8-pr25.8691",
|
|
4
4
|
"description": "Storage adapter for S3 compatible services",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@aws-sdk/client-s3": "^3.337.0",
|
|
35
35
|
"@aws-sdk/s3-request-presigner": "^3.342.0",
|
|
36
|
-
"@quatrain/storage": "^1.2.
|
|
36
|
+
"@quatrain/storage": "^1.2.13",
|
|
37
37
|
"fs-extra": "^11.2.0"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
package/src/S3StorageAdapter.ts
CHANGED
|
@@ -87,9 +87,15 @@ export class S3StorageAdapter extends AbstractStorageAdapter {
|
|
|
87
87
|
*/
|
|
88
88
|
async streamToBuffer(stream: Stream): Promise<Buffer> {
|
|
89
89
|
return new Promise<Buffer>((resolve, reject) => {
|
|
90
|
-
const _buf:
|
|
90
|
+
const _buf: Buffer[] = []
|
|
91
91
|
|
|
92
|
-
stream.on('data', (chunk) =>
|
|
92
|
+
stream.on('data', (chunk) => {
|
|
93
|
+
if (typeof chunk === 'string') {
|
|
94
|
+
_buf.push(Buffer.from(chunk, 'utf-8'))
|
|
95
|
+
} else {
|
|
96
|
+
_buf.push(Buffer.from(chunk))
|
|
97
|
+
}
|
|
98
|
+
})
|
|
93
99
|
stream.on('end', () => resolve(Buffer.concat(_buf)))
|
|
94
100
|
stream.on('error', (err) => reject(err))
|
|
95
101
|
})
|