From 86d13f2f28177385611613bfdeaf96084a15f203 Mon Sep 17 00:00:00 2001 From: Yufan Sheng Date: Mon, 8 Jul 2024 22:52:19 +0800 Subject: [PATCH] fix: isFile is not good to use for now. --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index b3071a9..3eccf45 100644 --- a/src/index.ts +++ b/src/index.ts @@ -97,12 +97,12 @@ class Uploader { async isExist(key: string, size: number): Promise { try { - const { contentLength, isFile } = await this.operator.stat(key); + const { contentLength } = await this.operator.stat(key); if ((contentLength !== null && contentLength !== BigInt(size)) || this.override) { await this.operator.delete(key); return false; } - return isFile(); + return true; } catch (err) { // Just ignore the error for now. If we find better solution for how to handle the opendal error. if (err instanceof Error) {