kossnocorp / typesaurus

🦕 Type-safe TypeScript-first ODM for Firestore
https://typesaurus.com
412 stars 34 forks source link

Add typesaurusSettings function with undefinedToNull setting #111

Closed SrBrahma closed 5 months ago

SrBrahma commented 2 years ago

Based on https://github.com/kossnocorp/typesaurus/issues/100,

Now it's exported typesaurusSettings(settings: Partial<TypesaurusSettings>): void, with type TypesaurusSettings = { undefinedToNull: boolean; }

To keep its current behavior, undefinedToNull defaults to true.

To use it, simply call typesaurusSettings({undefinedToNull: false}) before write operations are made in your code.

kossnocorp commented 5 months ago

Thank you for the PR, sorry for not merging it but the problem got addressed in v10: https://typesaurus.com/decisions/adr-1-undefined/