firebase-admin-node
firebase-admin-node copied to clipboard
onDocumentUpdate event is typed as having data potentially undefined
It seems weird that an update event could contain nothing, if that's the case an update event did not occur, did it ?
// firestore.d.ts
export declare function onDocumentUpdated<Document extends string>(document: Document, handler: (event: FirestoreEvent<Change<QueryDocumentSnapshot> | undefined, ParamsOf<Document>>) => any | Promise<any>): CloudFunction<FirestoreEvent<Change<QueryDocumentSnapshot> | undefined, ParamsOf<Document>>>;
It is annoying because it forces an additional, seemingly unnecessary, check.