Skip to content

The result of build has some nulls removed #296

@kenchan0130

Description

@kenchan0130

For example,

async findById(id: string) {
return this.firestoreColRef
.doc(id)
.get()
.then(d => (d.exists ? this.extractTFromDocSnap(d) : null));
}
method is expected to return Promise<T | null>.
However, if you check the yarn build generated lib/src/BaseFirestoreRepository.d.ts, we will see Promise<T>.

This is very unfortunate because it is giving up the benefit of the type itself.

The likely cause is that strictNullChecks has been false.

I tried to build with strictNullChecks set to true, but I got 249 errors and found that I had to change a lot of this library.

Because of this situation, I think it is better to let the owner decide or fix the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions