Skip to content

Commit a56148a

Browse files
committed
discourage use of getData by making "private"
1 parent 3bec033 commit a56148a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/firestore-document.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ MockFirestoreDocument.prototype.getFlushQueue = function () {
5050
return this.queue.getEvents();
5151
};
5252

53-
MockFirestoreDocument.prototype.getData = function () {
53+
MockFirestoreDocument.prototype._getData = function () {
5454
return _.cloneDeep(this.data);
5555
};
5656

@@ -79,7 +79,7 @@ MockFirestoreDocument.prototype.get = function () {
7979
return new Promise(function (resolve, reject) {
8080
self._defer('get', _.toArray(arguments), function () {
8181
if (err === null) {
82-
resolve(new DocumentSnapshot(self.id, self.ref, self.getData()));
82+
resolve(new DocumentSnapshot(self.id, self.ref, self._getData()));
8383
} else {
8484
reject(err);
8585
}
@@ -118,7 +118,7 @@ MockFirestoreDocument.prototype._update = function (changes, opts, callback) {
118118
return new Promise(function (resolve, reject) {
119119
self._defer('update', _.toArray(arguments), function () {
120120
if (!err) {
121-
var base = self.getData();
121+
var base = self._getData();
122122
var data;
123123
if (_opts.setMerge) {
124124
data = _.merge(_.isObject(base) ? base : {}, changes);

src/firestore-query.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ MockFirestoreQuery.prototype._setData = function (data) {
5353
this.data = utils.cleanFirestoreData(_.cloneDeep(data) || null);
5454
};
5555

56-
MockFirestoreQuery.prototype.getData = function () {
56+
MockFirestoreQuery.prototype._getData = function () {
5757
return _.cloneDeep(this.data);
5858
};
5959

@@ -138,14 +138,14 @@ MockFirestoreQuery.prototype.where = function (property, operator, value) {
138138
};
139139

140140
MockFirestoreQuery.prototype.orderBy = function (property, direction) {
141-
var query = new MockFirestoreQuery(this.path, this.getData(), this.parent, this.id);
141+
var query = new MockFirestoreQuery(this.path, this._getData(), this.parent, this.id);
142142
query.orderedProperties.push(property);
143143
query.orderedDirections.push(direction || 'asc');
144144
return query;
145145
};
146146

147147
MockFirestoreQuery.prototype.limit = function (limit) {
148-
var query = new MockFirestoreQuery(this.path, this.getData(), this.parent, this.id);
148+
var query = new MockFirestoreQuery(this.path, this._getData(), this.parent, this.id);
149149
query.limited = limit;
150150
return query;
151151
};

0 commit comments

Comments
 (0)