kubernetes-fluent-client 1.3.0 → 1.3.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":";AAIA,OAAiB,EAAc,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,IAAI,EAAE,CAAC,CAAC;IACR,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAsB,KAAK,CAAC,CAAC,EAC3B,GAAG,EAAE,GAAG,GAAG,WAAW,EACtB,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CA0C3B"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":";AAIA,OAAiB,EAAc,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,IAAI,EAAE,CAAC,CAAC;IACR,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAsB,KAAK,CAAC,CAAC,EAC3B,GAAG,EAAE,GAAG,GAAG,WAAW,EACtB,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAwC3B"}
package/dist/fetch.js CHANGED
@@ -46,15 +46,13 @@ async function fetch(url, init) {
46
46
  try {
47
47
  const resp = await (0, node_fetch_1.default)(url, init);
48
48
  const contentType = resp.headers.get("content-type") || "";
49
- if (resp.ok) {
50
- // Parse the response as JSON if the content type is JSON
51
- if (contentType.includes("application/json")) {
52
- data = await resp.json();
53
- }
54
- else {
55
- // Otherwise, return however the response was read
56
- data = (await resp.text());
57
- }
49
+ // Parse the response as JSON if the content type is JSON
50
+ if (contentType.includes("application/json")) {
51
+ data = await resp.json();
52
+ }
53
+ else {
54
+ // Otherwise, return however the response was read
55
+ data = (await resp.text());
58
56
  }
59
57
  return {
60
58
  data,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kubernetes-fluent-client",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A @kubernetes/client-node fluent API wrapper that leverages K8s Server Side Apply",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/fetch.ts CHANGED
@@ -33,14 +33,12 @@ export async function fetch<T>(
33
33
  const resp = await fetchRaw(url, init);
34
34
  const contentType = resp.headers.get("content-type") || "";
35
35
 
36
- if (resp.ok) {
37
- // Parse the response as JSON if the content type is JSON
38
- if (contentType.includes("application/json")) {
39
- data = await resp.json();
40
- } else {
41
- // Otherwise, return however the response was read
42
- data = (await resp.text()) as unknown as T;
43
- }
36
+ // Parse the response as JSON if the content type is JSON
37
+ if (contentType.includes("application/json")) {
38
+ data = await resp.json();
39
+ } else {
40
+ // Otherwise, return however the response was read
41
+ data = (await resp.text()) as unknown as T;
44
42
  }
45
43
 
46
44
  return {