backend-manager 3.0.30 → 3.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "3.0.30",
3
+ "version": "3.0.32",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -54,12 +54,17 @@ Utilities.prototype.iterateCollection = function (callback, options) {
54
54
 
55
55
  batch++;
56
56
 
57
+ if (snap.docs.length === 0) {
58
+ return resolve();
59
+ }
60
+
57
61
  if (options.log) {
58
62
  console.log('Processing batch:', batch);
59
63
  }
60
64
 
61
65
  callback({
62
- snap: snap, docs: snap.docs.map(x => x)
66
+ snap: snap,
67
+ docs: snap.docs.map(x => x),
63
68
  }, batch)
64
69
  .then(r => {
65
70
  // Construct a new query starting at this document
@@ -106,6 +111,10 @@ Utilities.prototype.iterateUsers = function (callback, options) {
106
111
 
107
112
  batch++;
108
113
 
114
+ if (listUsersResult.users.length === 0) {
115
+ return resolve();
116
+ }
117
+
109
118
  if (options.log) {
110
119
  console.log('Processing batch:', batch);
111
120
  }