Skip to content

Commit d190a72

Browse files
move NO_MORE_RESULTS to constant
1 parent 7fdf7e9 commit d190a72

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/datastore/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ var util = require('../common/util.js');
221221
* contacts: entities
222222
* };
223223
*
224-
* if (info.moreResults !== 'NO_MORE_RESULTS') {
224+
* var moreResultsMayExist = info.moreResults !== datastore.NO_MORE_RESULTS;
225+
*
226+
* if (moreResultsMayExist) {
225227
* frontEndResponse.nextPageCursor = info.endCursor;
226228
* }
227229
*
@@ -396,6 +398,8 @@ Datastore.int = function(value) {
396398
return new entity.Int(value);
397399
};
398400

401+
Datastore.NO_MORE_RESULTS = 'NO_MORE_RESULTS';
402+
399403
/**
400404
* Create a query for the specified kind. See {module:datastore/query} for all
401405
* of the available methods.

test/datastore/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ describe('Datastore', function() {
190190
});
191191
});
192192

193+
describe('NO_MORE_RESULTS', function() {
194+
it('should expose a NO_MORE_RESULTS helper', function() {
195+
assert.strictEqual(Datastore.NO_MORE_RESULTS, 'NO_MORE_RESULTS');
196+
});
197+
});
198+
193199
describe('createQuery', function() {
194200
it('should return a Query object', function() {
195201
var namespace = 'namespace';

0 commit comments

Comments
 (0)