@empiricalrun/r2-uploader 0.3.3 → 0.3.4
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/CHANGELOG.md +6 -0
- package/dist/fetch.d.ts.map +1 -1
- package/dist/fetch.js +13 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/fetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,UAAU,WAAkB,aAAa;;;;
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,UAAU,WAAkB,aAAa;;;;gBA2BrD,CAAC"}
|
package/dist/fetch.js
CHANGED
|
@@ -17,12 +17,18 @@ const fetchFiles = async (config) => {
|
|
|
17
17
|
};
|
|
18
18
|
const cmd = new client_s3_1.ListObjectsV2Command(params);
|
|
19
19
|
const data = await S3.send(cmd);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
const { KeyCount, Contents } = data;
|
|
21
|
+
if (KeyCount === 0) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return Contents?.map((c) => {
|
|
26
|
+
return {
|
|
27
|
+
key: c.Key,
|
|
28
|
+
lastModified: c.LastModified,
|
|
29
|
+
size: c.Size,
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
}
|
|
27
33
|
};
|
|
28
34
|
exports.fetchFiles = fetchFiles;
|