Skip to content

Commit

Permalink
[types][flow] Fix invertase#1205
Browse files Browse the repository at this point in the history
  • Loading branch information
Salakar authored and Guy Blank committed Jan 15, 2019
1 parent f8e7839 commit 035d6c8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/modules/firestore/CollectionReference.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class CollectionReference {
return this._firestore;
}

get id(): string | null {
get id(): string {
return this._collectionPath.id;
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/firestore/DocumentReference.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class DocumentReference {
return this._firestore;
}

get id(): string | null {
get id(): string {
return this._documentPath.id;
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/firestore/DocumentSnapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class DocumentSnapshot {
return this._data !== undefined;
}

get id(): string | null {
get id(): string {
return this._ref.id;
}

Expand Down
5 changes: 3 additions & 2 deletions src/modules/firestore/Path.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export default class Path {
this._parts = pathComponents;
}

get id(): string | null {
return this._parts.length ? this._parts[this._parts.length - 1] : null;
get id(): string {
// TODO is length check required?
return this._parts.length ? this._parts[this._parts.length - 1] : '';
}

get isDocument(): boolean {
Expand Down

0 comments on commit 035d6c8

Please sign in to comment.