@aws-amplify/predictions 4.0.22 → 4.0.23-unstable.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.
@@ -91828,6 +91828,8 @@ function Parser(options) {
91828
91828
  this.replaceCDATAstr = replaceCDATAstr;
91829
91829
  this.replaceCDATAarr = replaceCDATAarr;
91830
91830
 
91831
+ this.processTextOrObjNode = processTextOrObjNode
91832
+
91831
91833
  if (this.options.format) {
91832
91834
  this.indentate = indentate;
91833
91835
  this.tagEndChar = '>\n';
@@ -91864,10 +91866,7 @@ Parser.prototype.parse = function(jObj) {
91864
91866
  Parser.prototype.j2x = function(jObj, level) {
91865
91867
  let attrStr = '';
91866
91868
  let val = '';
91867
- const keys = Object.keys(jObj);
91868
- const len = keys.length;
91869
- for (let i = 0; i < len; i++) {
91870
- const key = keys[i];
91869
+ for (let key in jObj) {
91871
91870
  if (typeof jObj[key] === 'undefined') {
91872
91871
  // supress undefined node
91873
91872
  } else if (jObj[key] === null) {
@@ -91916,8 +91915,7 @@ Parser.prototype.j2x = function(jObj, level) {
91916
91915
  } else if (item === null) {
91917
91916
  val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
91918
91917
  } else if (typeof item === 'object') {
91919
- const result = this.j2x(item, level + 1);
91920
- val += this.buildObjNode(result.val, key, result.attrStr, level);
91918
+ val += this.processTextOrObjNode(item, key, level)
91921
91919
  } else {
91922
91920
  val += this.buildTextNode(item, key, '', level);
91923
91921
  }
@@ -91932,14 +91930,22 @@ Parser.prototype.j2x = function(jObj, level) {
91932
91930
  attrStr += ' ' + Ks[j] + '="' + this.options.attrValueProcessor('' + jObj[key][Ks[j]]) + '"';
91933
91931
  }
91934
91932
  } else {
91935
- const result = this.j2x(jObj[key], level + 1);
91936
- val += this.buildObjNode(result.val, key, result.attrStr, level);
91933
+ val += this.processTextOrObjNode(jObj[key], key, level)
91937
91934
  }
91938
91935
  }
91939
91936
  }
91940
91937
  return {attrStr: attrStr, val: val};
91941
91938
  };
91942
91939
 
91940
+ function processTextOrObjNode (object, key, level) {
91941
+ const result = this.j2x(object, level + 1);
91942
+ if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {
91943
+ return this.buildTextNode(result.val, key, result.attrStr, level);
91944
+ } else {
91945
+ return this.buildObjNode(result.val, key, result.attrStr, level);
91946
+ }
91947
+ }
91948
+
91943
91949
  function replaceCDATAstr(str, cdata) {
91944
91950
  str = this.options.tagValueProcessor('' + str);
91945
91951
  if (this.options.cdataPositionChar === '' || str === '') {
@@ -91962,7 +91968,7 @@ function replaceCDATAarr(str, cdata) {
91962
91968
  }
91963
91969
 
91964
91970
  function buildObjectNode(val, key, attrStr, level) {
91965
- if (attrStr && !val.includes('<')) {
91971
+ if (attrStr && val.indexOf('<') === -1) {
91966
91972
  return (
91967
91973
  this.indentate(level) +
91968
91974
  '<' +
@@ -96108,7 +96114,9 @@ function () {
96108
96114
  AWSS3Provider.prototype._createNewS3Client = function (config, emitter) {
96109
96115
  var region = config.region,
96110
96116
  cancelTokenSource = config.cancelTokenSource,
96111
- dangerouslyConnectToHttpEndpointForTesting = config.dangerouslyConnectToHttpEndpointForTesting;
96117
+ dangerouslyConnectToHttpEndpointForTesting = config.dangerouslyConnectToHttpEndpointForTesting,
96118
+ _a = config.useAccelerateEndpoint,
96119
+ useAccelerateEndpoint = _a === void 0 ? false : _a;
96112
96120
  var localTestingConfig = {};
96113
96121
 
96114
96122
  if (dangerouslyConnectToHttpEndpointForTesting) {
@@ -96127,7 +96135,8 @@ function () {
96127
96135
  credentials: this._credentialsProvider,
96128
96136
  customUserAgent: Object(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["getAmplifyUserAgent"])()
96129
96137
  }, localTestingConfig), {
96130
- requestHandler: new _axios_http_handler__WEBPACK_IMPORTED_MODULE_5__["AxiosHttpHandler"]({}, emitter, cancelTokenSource)
96138
+ requestHandler: new _axios_http_handler__WEBPACK_IMPORTED_MODULE_5__["AxiosHttpHandler"]({}, emitter, cancelTokenSource),
96139
+ useAccelerateEndpoint: useAccelerateEndpoint
96131
96140
  }));
96132
96141
  return s3client;
96133
96142
  };