Compare commits

..

No commits in common. "af6d0d91384b6860aa6d13eec9f7804125188e62" and "12f6075bc97c2a531cd6c4effec6f9eda2c0d0ad" have entirely different histories.

2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "astro-uploader", "name": "astro-uploader",
"version": "1.1.3", "version": "1.1.1",
"description": "A uploader for uploading the Astro generated files through the S3 API.", "description": "A uploader for uploading the Astro generated files through the S3 API.",
"keywords": ["Astro", "S3", "withastro", "opendal"], "keywords": ["Astro", "S3", "withastro", "opendal"],
"bugs": { "bugs": {

View File

@ -97,12 +97,12 @@ class Uploader {
async isExist(key: string, size: number): Promise<boolean> { async isExist(key: string, size: number): Promise<boolean> {
try { try {
const { contentLength } = await this.operator.stat(key); const { contentLength, isFile } = await this.operator.stat(key);
if ((contentLength !== null && contentLength !== BigInt(size)) || this.override) { if ((contentLength !== null && contentLength !== BigInt(size)) || this.override) {
await this.operator.delete(key); await this.operator.delete(key);
return false; return false;
} }
return true; return isFile();
} catch (err) { } catch (err) {
// Just ignore the error for now. If we find better solution for how to handle the opendal error. // Just ignore the error for now. If we find better solution for how to handle the opendal error.
if (err instanceof Error) { if (err instanceof Error) {