@digipair/skill-http 0.114.7 → 0.114.8
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/dist/index.cjs.js
CHANGED
|
@@ -32,11 +32,13 @@ let HttpService = class HttpService {
|
|
|
32
32
|
body
|
|
33
33
|
});
|
|
34
34
|
if (!response.ok) throw new Error('[SKILL-HTTP] REQUEST FAILED: ' + response.status);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
if (this.type === 'json' || this.type === 'text') {
|
|
36
|
+
const responseText = await response.text();
|
|
37
|
+
if (this.type === 'json' && !!responseText) {
|
|
38
|
+
result = JSON.parse(responseText);
|
|
39
|
+
} else {
|
|
40
|
+
result = await responseText;
|
|
41
|
+
}
|
|
40
42
|
} else {
|
|
41
43
|
const arrayBuffer = await response.arrayBuffer();
|
|
42
44
|
const buffer = Buffer.from(arrayBuffer);
|
package/dist/index.esm.js
CHANGED
|
@@ -30,11 +30,13 @@ let HttpService = class HttpService {
|
|
|
30
30
|
body
|
|
31
31
|
});
|
|
32
32
|
if (!response.ok) throw new Error('[SKILL-HTTP] REQUEST FAILED: ' + response.status);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
if (this.type === 'json' || this.type === 'text') {
|
|
34
|
+
const responseText = await response.text();
|
|
35
|
+
if (this.type === 'json' && !!responseText) {
|
|
36
|
+
result = JSON.parse(responseText);
|
|
37
|
+
} else {
|
|
38
|
+
result = await responseText;
|
|
39
|
+
}
|
|
38
40
|
} else {
|
|
39
41
|
const arrayBuffer = await response.arrayBuffer();
|
|
40
42
|
const buffer = Buffer.from(arrayBuffer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-http.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-http.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"skill-http.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-http.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA0JhD,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACN,CAAC;AAE7E,eAAO,MAAM,IAAI,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACN,CAAC;AAE3E,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACN,CAAC;AAE7E,eAAO,MAAM,aAAa,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACb,CAAC;AAE7E,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACN,CAAC;AAE7E,eAAO,MAAM,OAAO,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACN,CAAC;AAE9E,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACN,CAAC"}
|