gd-sprest 9.4.4 → 9.4.5
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/build/rest.js +1 -1
- package/build/utils/request.js +5 -4
- package/dist/gd-sprest.js +1 -1
- package/dist/gd-sprest.min.js +1 -1
- package/package.json +1 -1
package/build/rest.js
CHANGED
package/build/utils/request.js
CHANGED
|
@@ -507,6 +507,7 @@ exports.Request = {
|
|
|
507
507
|
},
|
|
508
508
|
// Method to convert the input arguments into an object
|
|
509
509
|
updateDataObject: function (base, isBatchRequest, batchIdx) {
|
|
510
|
+
var _a;
|
|
510
511
|
if (isBatchRequest === void 0) { isBatchRequest = false; }
|
|
511
512
|
if (batchIdx === void 0) { batchIdx = 0; }
|
|
512
513
|
// Ensure the request was successful
|
|
@@ -580,10 +581,10 @@ exports.Request = {
|
|
|
580
581
|
// Else, see if the data properties exists
|
|
581
582
|
else if (data.d) {
|
|
582
583
|
// Get the endpoint method to see if it's part of the response
|
|
583
|
-
var endpointInfo = base.targetInfo.endpoint.split('/');
|
|
584
|
-
var endpointMethod = endpointInfo[endpointInfo.length - 1] || "";
|
|
585
|
-
endpointMethod = endpointMethod[0].toUpperCase() + endpointMethod.substring(1);
|
|
586
|
-
if (data.d[endpointMethod]) {
|
|
584
|
+
var endpointInfo = ((_a = base.targetInfo.endpoint) === null || _a === void 0 ? void 0 : _a.split('/')) || "";
|
|
585
|
+
var endpointMethod = endpointInfo ? endpointInfo[endpointInfo.length - 1] || "" : "";
|
|
586
|
+
endpointMethod = endpointMethod ? endpointMethod[0].toUpperCase() + endpointMethod.substring(1) : "";
|
|
587
|
+
if (endpointMethod && data.d[endpointMethod]) {
|
|
587
588
|
// Update the response to be that object
|
|
588
589
|
data.d = data.d[endpointMethod];
|
|
589
590
|
}
|