remove: check zero size

This commit is contained in:
熊潇 2025-05-30 19:47:45 +08:00
parent ab29a1eb0b
commit 0dae4872b0
2 changed files with 1 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@kevisual/oss", "name": "@kevisual/oss",
"version": "0.0.11", "version": "0.0.12",
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"build": "tsup", "build": "tsup",

View File

@ -157,9 +157,6 @@ export class OssBase implements OssBaseOperation {
const bucketName = this.bucketName; const bucketName = this.bucketName;
try { try {
const obj = await this.client.statObject(bucketName, `${this.prefix}${objectName}`); const obj = await this.client.statObject(bucketName, `${this.prefix}${objectName}`);
if (obj && checkFile && obj.size === 0) {
return null;
}
return obj; return obj;
} catch (e) { } catch (e) {
if (e.code === 'NotFound') { if (e.code === 'NotFound') {