@faable/sdk-base 1.0.12 → 1.0.13

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/README.md CHANGED
@@ -6,13 +6,13 @@
6
6
  </p>
7
7
 
8
8
  <p align="center">
9
- <a aria-label="NPM version" href="https://www.npmjs.com/package/@faable/sdk-generic">
10
- <img alt="" src="https://img.shields.io/npm/v/@faable/sdk-generic.svg?style=for-the-badge&labelColor=000000">
9
+ <a aria-label="NPM version" href="https://www.npmjs.com/package/@faable/sdk-base">
10
+ <img alt="" src="https://img.shields.io/npm/v/@faable/sdk-base.svg?style=for-the-badge&labelColor=000000">
11
11
  </a>
12
12
  </p>
13
13
 
14
14
  ## Install
15
15
 
16
16
  ```bash
17
- npm install @faable/sdk-generic
17
+ npm install @faable/sdk-base
18
18
  ```
@@ -4,7 +4,7 @@ export const buildPaginator = (fetcher) => (req) => {
4
4
  all: async () => {
5
5
  const pages = [];
6
6
  let data;
7
- let nextCurrent = null;
7
+ let nextCurrent;
8
8
  do {
9
9
  data = await fetcher.request({
10
10
  ...req,
@@ -13,7 +13,7 @@ export const buildPaginator = (fetcher) => (req) => {
13
13
  : req.params,
14
14
  });
15
15
  // Next cursor cannot be the same as previous received one. Sanity check the api.
16
- if (nextCurrent == data?.next) {
16
+ if (data?.next != null && nextCurrent == data?.next) {
17
17
  throw new FaableApiError("Bad next cursor");
18
18
  }
19
19
  nextCurrent = data.next;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/sdk-base",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "author": "Marc Pomar <marc@faable.com>",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",