@v1ct0rbr/minivault-web 0.4.1 → 0.4.2

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.
@@ -37,7 +37,9 @@ var h = class extends Error {
37
37
  let r = await n.text().catch(() => void 0) ?? "";
38
38
  throw new h(`Minivault API ${t.method ?? "GET"} ${e} falhou (HTTP ${n.status})${r ? `: ${_(r)}` : ""}`, n.status, r);
39
39
  }
40
- return await n.json();
40
+ if (n.status === 204 || n.headers.get("content-length") === "0") return;
41
+ let r = await n.text();
42
+ return r ? JSON.parse(r) : void 0;
41
43
  } catch (t) {
42
44
  throw t instanceof h || console.error(`[minivault-web] erro em ${this.baseUrl}${e}`, t), t;
43
45
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v1ct0rbr/minivault-web",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Módulo independente de gerenciamento de backups (minivault). Consumível como pacote npm em qualquer app React. Cliente do minivault REST API (acesso tipicamente via proxy autenticado).",
5
5
  "author": "Victor Queiroga (https://www.linkedin.com/in/victor-queiroga)",
6
6
  "license": "MIT",