Skip to content

Commit 6397387

Browse files
author
Brian Chen
authored
Merge 881ee44 into 509c18f
2 parents 509c18f + 881ee44 commit 6397387

File tree

6 files changed

+576
-528
lines changed

6 files changed

+576
-528
lines changed

.changeset/clean-cameras-check.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/firestore': minor
3+
---
4+
5+
Fixed a bug where UpdateData did not recognize optional, dot-separated string fields

common/api-review/firestore-lite.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export { LogLevel }
191191

192192
// @public
193193
export type NestedUpdateFields<T extends Record<string, unknown>> = UnionToIntersection<{
194-
[K in keyof T & string]: T[K] extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<T[K]>> : never;
194+
[K in keyof T & string]: T[K] extends Record<string, unknown> | undefined ? AddPrefixToKeys<K, UpdateData<T[K]>> : never;
195195
}[keyof T & string]>;
196196

197197
// @public
@@ -332,7 +332,7 @@ export class Transaction {
332332
export type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
333333

334334
// @public
335-
export type UpdateData<T> = T extends Primitive ? T : T extends Map<infer K, infer V> ? Map<UpdateData<K>, UpdateData<V>> : T extends {} ? {
335+
export type UpdateData<T> = T extends undefined ? never : T extends Primitive ? T : T extends {} ? {
336336
[K in keyof T]?: UpdateData<T[K]> | FieldValue;
337337
} & NestedUpdateFields<T> : Partial<T>;
338338

0 commit comments

Comments
 (0)