Skip to content

Commit

Permalink
Remove toJSON() from index files
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Chen committed Jan 19, 2021
1 parent 2f63105 commit 7c31f91
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions packages/app-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ export interface FirebaseNamespace {
// Sets log handler for all Firebase components.
onLog(logCallback: LogCallback, options?: LogOptions): void;

toJSON(): object;

// The current SDK version.
SDK_VERSION: string;
}
Expand Down
1 change: 1 addition & 0 deletions packages/firestore/src/lite/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class FirebaseFirestore implements FirestoreService {

toJSON(): object {
return {
app: this.app.name,

This comment has been minimized.

Copy link
@schmidt-sebastian

schmidt-sebastian Jan 19, 2021

Contributor

Nit: Since we have a toJSON on App, we should use it. If you don't deem its information useful, then we should update it at the source.

Optional.

This comment has been minimized.

Copy link
@schmidt-sebastian

schmidt-sebastian Jan 19, 2021

Contributor

(also sorry for the back and forth here - all my conflicting information makes sense in my head, but I can't put it to words)

This comment has been minimized.

Copy link
@thebrianchen

thebrianchen Jan 19, 2021

I see what you mean -- since we have a toJSON() on App, we might as well use it. Updated.

databaseId: this._databaseId,
settings: this._settings
};
Expand Down
3 changes: 0 additions & 3 deletions packages/firestore/test/unit/api/database.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ describe('DocumentSnapshot', () => {

it('JSON.stringify() does not throw', () => {
JSON.stringify(documentSnapshot('foo/bar', { a: 1 }, true));
JSON.stringify(documentSnapshot('foo/bar', { a: 1 }, false));
JSON.stringify(documentSnapshot('foo/bar', null, true));
JSON.stringify(documentSnapshot('foo/bar', null, false));
});
});

Expand Down

0 comments on commit 7c31f91

Please sign in to comment.