According to the API docs for listObjectsV2 obj.name and obj.etag are string and obj.lastModified is Date. Based on BucketItem type in the code and the following observed error from tsc, it seems they can also be undefined or never:
error TS2345: Argument of type 'BucketItem' is not assignable to parameter of type '{ name: string; }'. Type '{ name?: undefined; etag?: undefined; lastModified?: undefined; prefix: string; size: 0; }' is not assignable to type '{ name: string; }'. Types of property 'name' are incompatible. Type 'undefined' is not assignable to type 'string'.
- Does this pose any risk during runtime?
- Is it safe to use the types like
BucketItem from src/internal/type.ts?
- Maybe the documentation could be updated to reflect something about this?
According to the API docs for listObjectsV2
obj.nameandobj.etagarestringandobj.lastModifiedisDate. Based onBucketItemtype in the code and the following observed error fromtsc, it seems they can also beundefinedornever:BucketItemfromsrc/internal/type.ts?