Skip to content

ObjectMetadata property "name" is optional #1248

Closed
@xxRockOnxx

Description

@xxRockOnxx

Related issues

None

[REQUIRED] Version info

node:

firebase-functions: 3.24.0

firebase-tools:

firebase-admin:

[REQUIRED] Test case

functions.storage.object().onFinalize((object) => {
  if (object?.name) {
  }
})

[REQUIRED] Steps to reproduce

  • Open editor/IDE
  • Copy code from test case
  • Check if property name is optional

[REQUIRED] Expected behavior

property name is required

Image taken from https://firebase.google.com/docs/reference/functions/firebase-functions.storage.objectmetadata.md#storageobjectmetadata_interface
image

[REQUIRED] Actual behavior

property name is optional

https://github.com/firebase/firebase-functions/blob/v3.24.0/src/providers/storage.ts#L263-L265

Is this intentional? Is there really times where name is non-existent?

Or is the docs correct and this is just a typo/mistake? I could send a PR since it's just a removal of ? from the type.

Were you able to successfully deploy your functions?

Yes

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions