Skip to content

Commit

Permalink
fix: Remove incorrect,unreachable and unused code (#1983)
Browse files Browse the repository at this point in the history
* Prevent Serialization of firestore

The toJSON function spelling name is incorrect therefore this method is not triggered when using JSON.stringify on firestore objects

* Remove unused code

This code is never invoked, the spelling of toJSON is also wrong (  it is toJson here) 
Also the Firestore Class toJSON method works well now for protecting the private keys of firestore instance

---------

Co-authored-by: Mila <107142260+milaGGL@users.noreply.github.com>
  • Loading branch information
abhishekwebcode and milaGGL authored Jan 22, 2024
1 parent ecfb8fe commit 133f4da
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions dev/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -745,13 +745,6 @@ export class Firestore implements firestore.Firestore {
}

this._settings = settings;
this._settings.toJson = function () {
const temp = Object.assign({}, this);
if (temp.credentials) {
temp.credentials = {private_key: '***', client_email: '***'};
}
return temp;
};
this._serializer = new Serializer(this);
}

Expand Down

0 comments on commit 133f4da

Please sign in to comment.