@readyfor/api-client-base 0.250.0 → 0.251.0

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.
@@ -20,7 +20,8 @@ var createJsonFetcher = (schema, customRequestInit = {}) => (input, requestInit
20
20
  mergeRequestInit(customRequestInit, requestInit)
21
21
  )
22
22
  ).then(async (res) => {
23
- const body = await res.json();
23
+ const text = await res.text();
24
+ const body = text ? JSON.parse(text) : {};
24
25
  if (res.ok) return body;
25
26
  const code = Object.values(errorStatusCode).includes(res.status) ? res.status : 999;
26
27
  const error = new HTTPError(code, body);
package/dist/fetcher.js CHANGED
@@ -37,7 +37,8 @@ const createJsonFetcher = (schema, customRequestInit = {}) => (input, requestIni
37
37
  (0, import_requestInit.mergeRequestInit)(customRequestInit, requestInit)
38
38
  )
39
39
  ).then(async (res) => {
40
- const body = await res.json();
40
+ const text = await res.text();
41
+ const body = text ? JSON.parse(text) : {};
41
42
  if (res.ok) return body;
42
43
  const code = Object.values(import_apiError.errorStatusCode).includes(res.status) ? res.status : 999;
43
44
  const error = new import_apiError.HTTPError(code, body);
package/dist/fetcher.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  createJsonFetcher,
4
4
  createTextFetcher,
5
5
  createVoidFetcher
6
- } from "./chunk-E3EKMNYV.mjs";
6
+ } from "./chunk-AUMV34BX.mjs";
7
7
  import "./chunk-PY35XWDS.mjs";
8
8
  import "./chunk-Z2IX5DM2.mjs";
9
9
  import "./chunk-2ORFVC4H.mjs";
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  createJsonFetcher,
4
4
  createTextFetcher,
5
5
  createVoidFetcher
6
- } from "./chunk-E3EKMNYV.mjs";
6
+ } from "./chunk-AUMV34BX.mjs";
7
7
  import {
8
8
  HTTPError,
9
9
  errorStatusCode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readyfor/api-client-base",
3
- "version": "0.250.0",
3
+ "version": "0.251.0",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -75,5 +75,5 @@
75
75
  "!src/**/*.test.tsx"
76
76
  ]
77
77
  },
78
- "gitHead": "92c52801b98539e17f0085efcd835e1f99dfc5cc"
78
+ "gitHead": "64f780ab1ab05c10df05706d927740ec235ce111"
79
79
  }