@truto/truto-jsonata 1.0.51 → 1.0.52

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.
@@ -35020,8 +35020,23 @@ var require_formats = __commonJS((exports, module) => {
35020
35020
  // node_modules/qs/lib/utils.js
35021
35021
  var require_utils2 = __commonJS((exports, module) => {
35022
35022
  var formats = require_formats();
35023
+ var getSideChannel = require_side_channel();
35023
35024
  var has2 = Object.prototype.hasOwnProperty;
35024
35025
  var isArray4 = Array.isArray;
35026
+ var overflowChannel = getSideChannel();
35027
+ var markOverflow = function markOverflow(obj, maxIndex) {
35028
+ overflowChannel.set(obj, maxIndex);
35029
+ return obj;
35030
+ };
35031
+ var isOverflow = function isOverflow(obj) {
35032
+ return overflowChannel.has(obj);
35033
+ };
35034
+ var getMaxIndex = function getMaxIndex(obj) {
35035
+ return overflowChannel.get(obj);
35036
+ };
35037
+ var setMaxIndex = function setMaxIndex(obj, maxIndex) {
35038
+ overflowChannel.set(obj, maxIndex);
35039
+ };
35025
35040
  var hexTable = function() {
35026
35041
  var array = [];
35027
35042
  for (var i2 = 0;i2 < 256; ++i2) {
@@ -35061,7 +35076,11 @@ var require_utils2 = __commonJS((exports, module) => {
35061
35076
  if (isArray4(target)) {
35062
35077
  target.push(source);
35063
35078
  } else if (target && typeof target === "object") {
35064
- if (options3 && (options3.plainObjects || options3.allowPrototypes) || !has2.call(Object.prototype, source)) {
35079
+ if (isOverflow(target)) {
35080
+ var newIndex = getMaxIndex(target) + 1;
35081
+ target[newIndex] = source;
35082
+ setMaxIndex(target, newIndex);
35083
+ } else if (options3 && (options3.plainObjects || options3.allowPrototypes) || !has2.call(Object.prototype, source)) {
35065
35084
  target[source] = true;
35066
35085
  }
35067
35086
  } else {
@@ -35070,6 +35089,15 @@ var require_utils2 = __commonJS((exports, module) => {
35070
35089
  return target;
35071
35090
  }
35072
35091
  if (!target || typeof target !== "object") {
35092
+ if (isOverflow(source)) {
35093
+ var sourceKeys = Object.keys(source);
35094
+ var result = options3 && options3.plainObjects ? { __proto__: null, 0: target } : { 0: target };
35095
+ for (var m = 0;m < sourceKeys.length; m++) {
35096
+ var oldKey = parseInt(sourceKeys[m], 10);
35097
+ result[oldKey + 1] = source[sourceKeys[m]];
35098
+ }
35099
+ return markOverflow(result, getMaxIndex(source) + 1);
35100
+ }
35073
35101
  return [target].concat(source);
35074
35102
  }
35075
35103
  var mergeTarget = target;
@@ -35192,8 +35220,18 @@ var require_utils2 = __commonJS((exports, module) => {
35192
35220
  }
35193
35221
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
35194
35222
  };
35195
- var combine = function combine(a, b) {
35196
- return [].concat(a, b);
35223
+ var combine = function combine(a, b, arrayLimit, plainObjects) {
35224
+ if (isOverflow(a)) {
35225
+ var newIndex = getMaxIndex(a) + 1;
35226
+ a[newIndex] = b;
35227
+ setMaxIndex(a, newIndex);
35228
+ return a;
35229
+ }
35230
+ var result = [].concat(a, b);
35231
+ if (result.length > arrayLimit) {
35232
+ return markOverflow(arrayToObject(result, { plainObjects }), result.length - 1);
35233
+ }
35234
+ return result;
35197
35235
  };
35198
35236
  var maybeMap = function maybeMap(val, fn) {
35199
35237
  if (isArray4(val)) {
@@ -35213,6 +35251,7 @@ var require_utils2 = __commonJS((exports, module) => {
35213
35251
  decode,
35214
35252
  encode,
35215
35253
  isBuffer: isBuffer3,
35254
+ isOverflow,
35216
35255
  isRegExp: isRegExp3,
35217
35256
  maybeMap,
35218
35257
  merge
@@ -35543,9 +35582,11 @@ var require_parse = __commonJS((exports, module) => {
35543
35582
  val = options3.strictNullHandling ? null : "";
35544
35583
  } else {
35545
35584
  key = options3.decoder(part.slice(0, pos), defaults.decoder, charset2, "key");
35546
- val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options3, isArray4(obj[key]) ? obj[key].length : 0), function(encodedVal) {
35547
- return options3.decoder(encodedVal, defaults.decoder, charset2, "value");
35548
- });
35585
+ if (key !== null) {
35586
+ val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options3, isArray4(obj[key]) ? obj[key].length : 0), function(encodedVal) {
35587
+ return options3.decoder(encodedVal, defaults.decoder, charset2, "value");
35588
+ });
35589
+ }
35549
35590
  }
35550
35591
  if (val && options3.interpretNumericEntities && charset2 === "iso-8859-1") {
35551
35592
  val = interpretNumericEntities(String(val));
@@ -35553,11 +35594,13 @@ var require_parse = __commonJS((exports, module) => {
35553
35594
  if (part.indexOf("[]=") > -1) {
35554
35595
  val = isArray4(val) ? [val] : val;
35555
35596
  }
35556
- var existing = has2.call(obj, key);
35557
- if (existing && options3.duplicates === "combine") {
35558
- obj[key] = utils.combine(obj[key], val);
35559
- } else if (!existing || options3.duplicates === "last") {
35560
- obj[key] = val;
35597
+ if (key !== null) {
35598
+ var existing = has2.call(obj, key);
35599
+ if (existing && options3.duplicates === "combine") {
35600
+ obj[key] = utils.combine(obj[key], val, options3.arrayLimit, options3.plainObjects);
35601
+ } else if (!existing || options3.duplicates === "last") {
35602
+ obj[key] = val;
35603
+ }
35561
35604
  }
35562
35605
  }
35563
35606
  return obj;
@@ -35573,7 +35616,11 @@ var require_parse = __commonJS((exports, module) => {
35573
35616
  var obj;
35574
35617
  var root3 = chain[i2];
35575
35618
  if (root3 === "[]" && options3.parseArrays) {
35576
- obj = options3.allowEmptyArrays && (leaf === "" || options3.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf);
35619
+ if (utils.isOverflow(leaf)) {
35620
+ obj = leaf;
35621
+ } else {
35622
+ obj = options3.allowEmptyArrays && (leaf === "" || options3.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf, options3.arrayLimit, options3.plainObjects);
35623
+ }
35577
35624
  } else {
35578
35625
  obj = options3.plainObjects ? { __proto__: null } : {};
35579
35626
  var cleanRoot = root3.charAt(0) === "[" && root3.charAt(root3.length - 1) === "]" ? root3.slice(1, -1) : root3;
@@ -35592,14 +35639,19 @@ var require_parse = __commonJS((exports, module) => {
35592
35639
  }
35593
35640
  return leaf;
35594
35641
  };
35595
- var parseKeys = function parseQueryStringKeys(givenKey, val, options3, valuesParsed) {
35596
- if (!givenKey) {
35597
- return;
35598
- }
35642
+ var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options3) {
35599
35643
  var key = options3.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
35644
+ if (options3.depth <= 0) {
35645
+ if (!options3.plainObjects && has2.call(Object.prototype, key)) {
35646
+ if (!options3.allowPrototypes) {
35647
+ return;
35648
+ }
35649
+ }
35650
+ return [key];
35651
+ }
35600
35652
  var brackets = /(\[[^[\]]*])/;
35601
35653
  var child = /(\[[^[\]]*])/g;
35602
- var segment = options3.depth > 0 && brackets.exec(key);
35654
+ var segment = brackets.exec(key);
35603
35655
  var parent2 = segment ? key.slice(0, segment.index) : key;
35604
35656
  var keys2 = [];
35605
35657
  if (parent2) {
@@ -35611,9 +35663,10 @@ var require_parse = __commonJS((exports, module) => {
35611
35663
  keys2.push(parent2);
35612
35664
  }
35613
35665
  var i2 = 0;
35614
- while (options3.depth > 0 && (segment = child.exec(key)) !== null && i2 < options3.depth) {
35666
+ while ((segment = child.exec(key)) !== null && i2 < options3.depth) {
35615
35667
  i2 += 1;
35616
- if (!options3.plainObjects && has2.call(Object.prototype, segment[1].slice(1, -1))) {
35668
+ var segmentContent = segment[1].slice(1, -1);
35669
+ if (!options3.plainObjects && has2.call(Object.prototype, segmentContent)) {
35617
35670
  if (!options3.allowPrototypes) {
35618
35671
  return;
35619
35672
  }
@@ -35626,6 +35679,16 @@ var require_parse = __commonJS((exports, module) => {
35626
35679
  }
35627
35680
  keys2.push("[" + key.slice(segment.index) + "]");
35628
35681
  }
35682
+ return keys2;
35683
+ };
35684
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options3, valuesParsed) {
35685
+ if (!givenKey) {
35686
+ return;
35687
+ }
35688
+ var keys2 = splitKeyIntoSegments(givenKey, options3);
35689
+ if (!keys2) {
35690
+ return;
35691
+ }
35629
35692
  return parseObject(keys2, val, options3, valuesParsed);
35630
35693
  };
35631
35694
  var normalizeParseOptions = function normalizeParseOptions(opts) {
@@ -76863,4 +76926,4 @@ export {
76863
76926
  trutoJsonata as default
76864
76927
  };
76865
76928
 
76866
- //# debugId=F1B366A39391A4F164756E2164756E21
76929
+ //# debugId=C7EDD6D99293C92E64756E2164756E21