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 CHANGED
@@ -9,7 +9,7 @@ var sptypes_1 = require("./sptypes");
9
9
  * SharePoint REST Library
10
10
  */
11
11
  exports.$REST = {
12
- __ver: 9.44,
12
+ __ver: 9.45,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,
@@ -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
  }