api-def 0.6.2-alpha.2 → 0.6.2-alpha.4
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/cjs/RequestContext.js +2 -2
- package/cjs/RequestError.js +3 -1
- package/esm/RequestContext.js +2 -2
- package/esm/RequestError.js +3 -1
- package/package.json +1 -1
package/cjs/RequestContext.js
CHANGED
|
@@ -135,9 +135,9 @@ var RequestContext = /** @class */ (function () {
|
|
|
135
135
|
for (var _i = 0, _a = Object.keys(this.computedConfig.body); _i < _a.length; _i++) {
|
|
136
136
|
var key = _a[_i];
|
|
137
137
|
var value = this.computedConfig.body[key];
|
|
138
|
-
searchParams.
|
|
138
|
+
searchParams.append(key, value === null || value === void 0 ? void 0 : value.toString());
|
|
139
139
|
}
|
|
140
|
-
this.parsedBody = searchParams
|
|
140
|
+
this.parsedBody = searchParams;
|
|
141
141
|
}
|
|
142
142
|
else {
|
|
143
143
|
this.parsedBody = this.computedConfig.body;
|
package/cjs/RequestError.js
CHANGED
|
@@ -14,6 +14,7 @@ var isRequestError = function (error) {
|
|
|
14
14
|
exports.isRequestError = isRequestError;
|
|
15
15
|
var convertToRequestError = function (config) {
|
|
16
16
|
var error = config.error, context = config.context, response = config.response, code = config.code;
|
|
17
|
+
var body = context.getParsedBody();
|
|
17
18
|
var resultError = Object.assign(error, {
|
|
18
19
|
name: "RequestError",
|
|
19
20
|
response: response,
|
|
@@ -23,11 +24,12 @@ var convertToRequestError = function (config) {
|
|
|
23
24
|
url: context.getRequestUrl().href,
|
|
24
25
|
query: context.computedConfig.query,
|
|
25
26
|
headers: context.computedConfig.headers,
|
|
26
|
-
body:
|
|
27
|
+
body: body,
|
|
27
28
|
},
|
|
28
29
|
});
|
|
29
30
|
delete resultError.config;
|
|
30
31
|
delete resultError.toJSON;
|
|
32
|
+
Object.setPrototypeOf(error, Error);
|
|
31
33
|
return resultError;
|
|
32
34
|
};
|
|
33
35
|
exports.convertToRequestError = convertToRequestError;
|
package/esm/RequestContext.js
CHANGED
|
@@ -133,9 +133,9 @@ var RequestContext = /** @class */ (function () {
|
|
|
133
133
|
for (var _i = 0, _a = Object.keys(this.computedConfig.body); _i < _a.length; _i++) {
|
|
134
134
|
var key = _a[_i];
|
|
135
135
|
var value = this.computedConfig.body[key];
|
|
136
|
-
searchParams.
|
|
136
|
+
searchParams.append(key, value === null || value === void 0 ? void 0 : value.toString());
|
|
137
137
|
}
|
|
138
|
-
this.parsedBody = searchParams
|
|
138
|
+
this.parsedBody = searchParams;
|
|
139
139
|
}
|
|
140
140
|
else {
|
|
141
141
|
this.parsedBody = this.computedConfig.body;
|
package/esm/RequestError.js
CHANGED
|
@@ -10,6 +10,7 @@ export var isRequestError = function (error) {
|
|
|
10
10
|
};
|
|
11
11
|
export var convertToRequestError = function (config) {
|
|
12
12
|
var error = config.error, context = config.context, response = config.response, code = config.code;
|
|
13
|
+
var body = context.getParsedBody();
|
|
13
14
|
var resultError = Object.assign(error, {
|
|
14
15
|
name: "RequestError",
|
|
15
16
|
response: response,
|
|
@@ -19,10 +20,11 @@ export var convertToRequestError = function (config) {
|
|
|
19
20
|
url: context.getRequestUrl().href,
|
|
20
21
|
query: context.computedConfig.query,
|
|
21
22
|
headers: context.computedConfig.headers,
|
|
22
|
-
body:
|
|
23
|
+
body: body,
|
|
23
24
|
},
|
|
24
25
|
});
|
|
25
26
|
delete resultError.config;
|
|
26
27
|
delete resultError.toJSON;
|
|
28
|
+
Object.setPrototypeOf(error, Error);
|
|
27
29
|
return resultError;
|
|
28
30
|
};
|