Skip to content

Docs: missing types for listObjectsV2 #1410

Open
@timglorioso

Description

@timglorioso

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'.
  1. Does this pose any risk during runtime?
  2. Is it safe to use the types like BucketItem from src/internal/type.ts?
  3. Maybe the documentation could be updated to reflect something about this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions