tsense 0.0.11 → 0.0.12

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.
Files changed (2) hide show
  1. package/dist/tsense.js +3 -3
  2. package/package.json +1 -1
package/dist/tsense.js CHANGED
@@ -378,7 +378,7 @@ export class TSense {
378
378
  }
379
379
  searchList(options) {
380
380
  return __awaiter(this, void 0, void 0, function* () {
381
- var _a, _b, _c, _d;
381
+ var _a, _b, _c, _d, _e;
382
382
  yield this.ensureSynced();
383
383
  const limit = Math.min((_a = options.limit) !== null && _a !== void 0 ? _a : 20, 100);
384
384
  const field = options.sort.field;
@@ -403,8 +403,8 @@ export class TSense {
403
403
  });
404
404
  const hits = (_d = res.hits) !== null && _d !== void 0 ? _d : [];
405
405
  const data = [];
406
- const lastHit = hits[hits.length - 1].document;
407
- const nextCursor = String(lastHit[field]);
406
+ const lastHit = (_e = hits[hits.length - 1]) === null || _e === void 0 ? void 0 : _e.document;
407
+ const nextCursor = lastHit ? String(lastHit[field]) : null;
408
408
  for (const hit of hits) {
409
409
  const doc = this.deserializeDoc(hit.document);
410
410
  data.push(doc);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsense",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "private": false,
5
5
  "description": "Opinionated, fully typed typesense client",
6
6
  "keywords": [