cdk-common 2.0.32 → 2.0.36

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.
Files changed (54) hide show
  1. package/.jsii +16 -4
  2. package/API.md +10 -0
  3. package/lib/main.js +1 -1
  4. package/lib/managed-policies.d.ts +8 -0
  5. package/lib/managed-policies.js +3 -1
  6. package/node_modules/@aws-cdk/assert/package.json +8 -8
  7. package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/index.html +1 -1
  8. package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/massage-spec.ts.html +1 -1
  9. package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/patch-set.ts.html +1 -1
  10. package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/scrutiny.ts.html +1 -1
  11. package/node_modules/@aws-cdk/cfnspec/coverage/build-tools/validate-cfn.ts.html +1 -1
  12. package/node_modules/@aws-cdk/cfnspec/coverage/index.html +1 -1
  13. package/node_modules/@aws-cdk/cfnspec/coverage/junit.xml +6305 -6305
  14. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/index.html +1 -1
  15. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/massage-spec.ts.html +1 -1
  16. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/patch-set.ts.html +1 -1
  17. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/scrutiny.ts.html +1 -1
  18. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/build-tools/validate-cfn.ts.html +1 -1
  19. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/index.html +1 -1
  20. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/canned-metrics/canned-metrics-schema.ts.html +1 -1
  21. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/canned-metrics/index.html +1 -1
  22. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/canned-metrics.ts.html +1 -1
  23. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/index.html +1 -1
  24. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/index.ts.html +1 -1
  25. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/augmentation.ts.html +1 -1
  26. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/base-types.ts.html +1 -1
  27. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/index.html +1 -1
  28. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/index.ts.html +1 -1
  29. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/property.ts.html +1 -1
  30. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/resource-type.ts.html +1 -1
  31. package/node_modules/@aws-cdk/cfnspec/coverage/lcov-report/lib/schema/specification.ts.html +1 -1
  32. package/node_modules/@aws-cdk/cfnspec/coverage/lib/canned-metrics/canned-metrics-schema.ts.html +1 -1
  33. package/node_modules/@aws-cdk/cfnspec/coverage/lib/canned-metrics/index.html +1 -1
  34. package/node_modules/@aws-cdk/cfnspec/coverage/lib/canned-metrics.ts.html +1 -1
  35. package/node_modules/@aws-cdk/cfnspec/coverage/lib/index.html +1 -1
  36. package/node_modules/@aws-cdk/cfnspec/coverage/lib/index.ts.html +1 -1
  37. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/augmentation.ts.html +1 -1
  38. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/base-types.ts.html +1 -1
  39. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/index.html +1 -1
  40. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/index.ts.html +1 -1
  41. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/property.ts.html +1 -1
  42. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/resource-type.ts.html +1 -1
  43. package/node_modules/@aws-cdk/cfnspec/coverage/lib/schema/specification.ts.html +1 -1
  44. package/node_modules/@aws-cdk/cfnspec/package.json +3 -3
  45. package/node_modules/@aws-cdk/cloudformation-diff/package.json +5 -5
  46. package/node_modules/qs/.eslintrc +5 -1
  47. package/node_modules/qs/CHANGELOG.md +6 -0
  48. package/node_modules/qs/dist/qs.js +73 -30
  49. package/node_modules/qs/lib/parse.js +1 -1
  50. package/node_modules/qs/lib/stringify.js +4 -4
  51. package/node_modules/qs/package.json +5 -5
  52. package/node_modules/qs/test/parse.js +60 -0
  53. package/package.json +5 -5
  54. package/node_modules/qs/.eslintignore +0 -2
@@ -175,7 +175,7 @@ var parseObject = function (chain, val, options, valuesParsed) {
175
175
  ) {
176
176
  obj = [];
177
177
  obj[index] = leaf;
178
- } else {
178
+ } else if (cleanRoot !== '__proto__') {
179
179
  obj[cleanRoot] = leaf;
180
180
  }
181
181
  }
@@ -384,7 +384,7 @@ var stringify = function stringify(
384
384
  var tmpSc = sideChannel;
385
385
  var step = 0;
386
386
  var findFlag = false;
387
- while ((tmpSc = tmpSc.get(sentinel)) !== undefined && !findFlag) {
387
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
388
388
  // Where object last appeared in the ref tree
389
389
  var pos = tmpSc.get(object);
390
390
  step += 1;
@@ -446,7 +446,7 @@ var stringify = function stringify(
446
446
  var objKeys;
447
447
  if (generateArrayPrefix === 'comma' && isArray(obj)) {
448
448
  // we need to join elements in
449
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : undefined }];
449
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
450
450
  } else if (isArray(filter)) {
451
451
  objKeys = filter;
452
452
  } else {
@@ -456,7 +456,7 @@ var stringify = function stringify(
456
456
 
457
457
  for (var j = 0; j < objKeys.length; ++j) {
458
458
  var key = objKeys[j];
459
- var value = typeof key === 'object' && key.value !== undefined ? key.value : obj[key];
459
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
460
460
 
461
461
  if (skipNulls && value === null) {
462
462
  continue;
@@ -496,7 +496,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
496
496
  return defaults;
497
497
  }
498
498
 
499
- if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
499
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
500
500
  throw new TypeError('Encoder has to be a function.');
501
501
  }
502
502
 
@@ -1419,11 +1419,24 @@ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
1419
1419
  var booleanValueOf = Boolean.prototype.valueOf;
1420
1420
  var objectToString = Object.prototype.toString;
1421
1421
  var functionToString = Function.prototype.toString;
1422
- var match = String.prototype.match;
1422
+ var $match = String.prototype.match;
1423
+ var $slice = String.prototype.slice;
1424
+ var $replace = String.prototype.replace;
1425
+ var $toUpperCase = String.prototype.toUpperCase;
1426
+ var $toLowerCase = String.prototype.toLowerCase;
1427
+ var $test = RegExp.prototype.test;
1428
+ var $concat = Array.prototype.concat;
1429
+ var $join = Array.prototype.join;
1430
+ var $arrSlice = Array.prototype.slice;
1431
+ var $floor = Math.floor;
1423
1432
  var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
1424
1433
  var gOPS = Object.getOwnPropertySymbols;
1425
1434
  var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
1426
1435
  var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
1436
+ // ie, `has-tostringtag/shams
1437
+ var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
1438
+ ? Symbol.toStringTag
1439
+ : null;
1427
1440
  var isEnumerable = Object.prototype.propertyIsEnumerable;
1428
1441
 
1429
1442
  var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
@@ -1434,9 +1447,30 @@ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPr
1434
1447
  : null
1435
1448
  );
1436
1449
 
1450
+ function addNumericSeparator(num, str) {
1451
+ if (
1452
+ num === Infinity
1453
+ || num === -Infinity
1454
+ || num !== num
1455
+ || (num && num > -1000 && num < 1000)
1456
+ || $test.call(/e/, str)
1457
+ ) {
1458
+ return str;
1459
+ }
1460
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
1461
+ if (typeof num === 'number') {
1462
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
1463
+ if (int !== num) {
1464
+ var intStr = String(int);
1465
+ var dec = $slice.call(str, intStr.length + 1);
1466
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
1467
+ }
1468
+ }
1469
+ return $replace.call(str, sepRegex, '$&_');
1470
+ }
1471
+
1437
1472
  var inspectCustom = require('./util.inspect').custom;
1438
1473
  var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
1439
- var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null;
1440
1474
 
1441
1475
  module.exports = function inspect_(obj, options, depth, seen) {
1442
1476
  var opts = options || {};
@@ -1463,8 +1497,12 @@ module.exports = function inspect_(obj, options, depth, seen) {
1463
1497
  && opts.indent !== '\t'
1464
1498
  && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
1465
1499
  ) {
1466
- throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');
1500
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
1467
1501
  }
1502
+ if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
1503
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
1504
+ }
1505
+ var numericSeparator = opts.numericSeparator;
1468
1506
 
1469
1507
  if (typeof obj === 'undefined') {
1470
1508
  return 'undefined';
@@ -1483,10 +1521,12 @@ module.exports = function inspect_(obj, options, depth, seen) {
1483
1521
  if (obj === 0) {
1484
1522
  return Infinity / obj > 0 ? '0' : '-0';
1485
1523
  }
1486
- return String(obj);
1524
+ var str = String(obj);
1525
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
1487
1526
  }
1488
1527
  if (typeof obj === 'bigint') {
1489
- return String(obj) + 'n';
1528
+ var bigIntStr = String(obj) + 'n';
1529
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
1490
1530
  }
1491
1531
 
1492
1532
  var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
@@ -1505,7 +1545,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
1505
1545
 
1506
1546
  function inspect(value, from, noIndent) {
1507
1547
  if (from) {
1508
- seen = seen.slice();
1548
+ seen = $arrSlice.call(seen);
1509
1549
  seen.push(from);
1510
1550
  }
1511
1551
  if (noIndent) {
@@ -1523,21 +1563,21 @@ module.exports = function inspect_(obj, options, depth, seen) {
1523
1563
  if (typeof obj === 'function') {
1524
1564
  var name = nameOf(obj);
1525
1565
  var keys = arrObjKeys(obj, inspect);
1526
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : '');
1566
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
1527
1567
  }
1528
1568
  if (isSymbol(obj)) {
1529
- var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
1569
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
1530
1570
  return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
1531
1571
  }
1532
1572
  if (isElement(obj)) {
1533
- var s = '<' + String(obj.nodeName).toLowerCase();
1573
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
1534
1574
  var attrs = obj.attributes || [];
1535
1575
  for (var i = 0; i < attrs.length; i++) {
1536
1576
  s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
1537
1577
  }
1538
1578
  s += '>';
1539
1579
  if (obj.childNodes && obj.childNodes.length) { s += '...'; }
1540
- s += '</' + String(obj.nodeName).toLowerCase() + '>';
1580
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
1541
1581
  return s;
1542
1582
  }
1543
1583
  if (isArray(obj)) {
@@ -1546,12 +1586,15 @@ module.exports = function inspect_(obj, options, depth, seen) {
1546
1586
  if (indent && !singleLineValues(xs)) {
1547
1587
  return '[' + indentedJoin(xs, indent) + ']';
1548
1588
  }
1549
- return '[ ' + xs.join(', ') + ' ]';
1589
+ return '[ ' + $join.call(xs, ', ') + ' ]';
1550
1590
  }
1551
1591
  if (isError(obj)) {
1552
1592
  var parts = arrObjKeys(obj, inspect);
1593
+ if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
1594
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
1595
+ }
1553
1596
  if (parts.length === 0) { return '[' + String(obj) + ']'; }
1554
- return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }';
1597
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
1555
1598
  }
1556
1599
  if (typeof obj === 'object' && customInspect) {
1557
1600
  if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
@@ -1599,14 +1642,14 @@ module.exports = function inspect_(obj, options, depth, seen) {
1599
1642
  var ys = arrObjKeys(obj, inspect);
1600
1643
  var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
1601
1644
  var protoTag = obj instanceof Object ? '' : 'null prototype';
1602
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : '';
1645
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
1603
1646
  var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
1604
- var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : '');
1647
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
1605
1648
  if (ys.length === 0) { return tag + '{}'; }
1606
1649
  if (indent) {
1607
1650
  return tag + '{' + indentedJoin(ys, indent) + '}';
1608
1651
  }
1609
- return tag + '{ ' + ys.join(', ') + ' }';
1652
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
1610
1653
  }
1611
1654
  return String(obj);
1612
1655
  };
@@ -1617,7 +1660,7 @@ function wrapQuotes(s, defaultStyle, opts) {
1617
1660
  }
1618
1661
 
1619
1662
  function quote(s) {
1620
- return String(s).replace(/"/g, '&quot;');
1663
+ return $replace.call(String(s), /"/g, '&quot;');
1621
1664
  }
1622
1665
 
1623
1666
  function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
@@ -1668,7 +1711,7 @@ function toStr(obj) {
1668
1711
 
1669
1712
  function nameOf(f) {
1670
1713
  if (f.name) { return f.name; }
1671
- var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/);
1714
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
1672
1715
  if (m) { return m[1]; }
1673
1716
  return null;
1674
1717
  }
@@ -1768,10 +1811,10 @@ function inspectString(str, opts) {
1768
1811
  if (str.length > opts.maxStringLength) {
1769
1812
  var remaining = str.length - opts.maxStringLength;
1770
1813
  var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
1771
- return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer;
1814
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
1772
1815
  }
1773
1816
  // eslint-disable-next-line no-control-regex
1774
- var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte);
1817
+ var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
1775
1818
  return wrapQuotes(s, 'single', opts);
1776
1819
  }
1777
1820
 
@@ -1785,7 +1828,7 @@ function lowbyte(c) {
1785
1828
  13: 'r'
1786
1829
  }[n];
1787
1830
  if (x) { return '\\' + x; }
1788
- return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase();
1831
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
1789
1832
  }
1790
1833
 
1791
1834
  function markBoxed(str) {
@@ -1797,7 +1840,7 @@ function weakCollectionOf(type) {
1797
1840
  }
1798
1841
 
1799
1842
  function collectionOf(type, size, entries, indent) {
1800
- var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', ');
1843
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
1801
1844
  return type + ' (' + size + ') {' + joinedEntries + '}';
1802
1845
  }
1803
1846
 
@@ -1815,20 +1858,20 @@ function getIndent(opts, depth) {
1815
1858
  if (opts.indent === '\t') {
1816
1859
  baseIndent = '\t';
1817
1860
  } else if (typeof opts.indent === 'number' && opts.indent > 0) {
1818
- baseIndent = Array(opts.indent + 1).join(' ');
1861
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
1819
1862
  } else {
1820
1863
  return null;
1821
1864
  }
1822
1865
  return {
1823
1866
  base: baseIndent,
1824
- prev: Array(depth + 1).join(baseIndent)
1867
+ prev: $join.call(Array(depth + 1), baseIndent)
1825
1868
  };
1826
1869
  }
1827
1870
 
1828
1871
  function indentedJoin(xs, indent) {
1829
1872
  if (xs.length === 0) { return ''; }
1830
1873
  var lineJoiner = '\n' + indent.prev + indent.base;
1831
- return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev;
1874
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
1832
1875
  }
1833
1876
 
1834
1877
  function arrObjKeys(obj, inspect) {
@@ -1855,7 +1898,7 @@ function arrObjKeys(obj, inspect) {
1855
1898
  if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
1856
1899
  // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
1857
1900
  continue; // eslint-disable-line no-restricted-syntax, no-continue
1858
- } else if ((/[^\w$]/).test(key)) {
1901
+ } else if ($test.call(/[^\w$]/, key)) {
1859
1902
  xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
1860
1903
  } else {
1861
1904
  xs.push(key + ': ' + inspect(obj[key], obj));
@@ -136,7 +136,7 @@ var parseObject = function (chain, val, options, valuesParsed) {
136
136
  ) {
137
137
  obj = [];
138
138
  obj[index] = leaf;
139
- } else {
139
+ } else if (cleanRoot !== '__proto__') {
140
140
  obj[cleanRoot] = leaf;
141
141
  }
142
142
  }
@@ -80,7 +80,7 @@ var stringify = function stringify(
80
80
  var tmpSc = sideChannel;
81
81
  var step = 0;
82
82
  var findFlag = false;
83
- while ((tmpSc = tmpSc.get(sentinel)) !== undefined && !findFlag) {
83
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
84
84
  // Where object last appeared in the ref tree
85
85
  var pos = tmpSc.get(object);
86
86
  step += 1;
@@ -142,7 +142,7 @@ var stringify = function stringify(
142
142
  var objKeys;
143
143
  if (generateArrayPrefix === 'comma' && isArray(obj)) {
144
144
  // we need to join elements in
145
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : undefined }];
145
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
146
146
  } else if (isArray(filter)) {
147
147
  objKeys = filter;
148
148
  } else {
@@ -152,7 +152,7 @@ var stringify = function stringify(
152
152
 
153
153
  for (var j = 0; j < objKeys.length; ++j) {
154
154
  var key = objKeys[j];
155
- var value = typeof key === 'object' && key.value !== undefined ? key.value : obj[key];
155
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
156
156
 
157
157
  if (skipNulls && value === null) {
158
158
  continue;
@@ -192,7 +192,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
192
192
  return defaults;
193
193
  }
194
194
 
195
- if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
195
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
196
196
  throw new TypeError('Encoder has to be a function.');
197
197
  }
198
198
 
@@ -2,7 +2,7 @@
2
2
  "name": "qs",
3
3
  "description": "A querystring parser that supports nesting and arrays, with a depth limit",
4
4
  "homepage": "https://github.com/ljharb/qs",
5
- "version": "6.10.2",
5
+ "version": "6.10.3",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/ljharb/qs.git"
@@ -33,11 +33,11 @@
33
33
  "side-channel": "^1.0.4"
34
34
  },
35
35
  "devDependencies": {
36
- "@ljharb/eslint-config": "^20.0.0",
36
+ "@ljharb/eslint-config": "^20.1.0",
37
37
  "aud": "^1.1.5",
38
38
  "browserify": "^16.5.2",
39
39
  "eclint": "^2.8.1",
40
- "eslint": "^8.4.0",
40
+ "eslint": "^8.6.0",
41
41
  "evalmd": "^0.0.19",
42
42
  "for-each": "^0.3.3",
43
43
  "has-symbols": "^1.0.2",
@@ -45,11 +45,11 @@
45
45
  "in-publish": "^2.0.1",
46
46
  "mkdirp": "^0.5.5",
47
47
  "nyc": "^10.3.2",
48
- "object-inspect": "^1.11.0",
48
+ "object-inspect": "^1.12.0",
49
49
  "qs-iconv": "^1.0.4",
50
50
  "safe-publish-latest": "^2.0.0",
51
51
  "safer-buffer": "^2.1.2",
52
- "tape": "^5.3.2"
52
+ "tape": "^5.4.0"
53
53
  },
54
54
  "scripts": {
55
55
  "prepublishOnly": "safe-publish-latest && npm run dist",
@@ -629,6 +629,66 @@ test('parse()', function (t) {
629
629
  st.end();
630
630
  });
631
631
 
632
+ t.test('dunder proto is ignored', function (st) {
633
+ var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42';
634
+ var result = qs.parse(payload, { allowPrototypes: true });
635
+
636
+ st.deepEqual(
637
+ result,
638
+ {
639
+ categories: {
640
+ length: '42'
641
+ }
642
+ },
643
+ 'silent [[Prototype]] payload'
644
+ );
645
+
646
+ var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true });
647
+
648
+ st.deepEqual(
649
+ plainResult,
650
+ {
651
+ __proto__: null,
652
+ categories: {
653
+ __proto__: null,
654
+ length: '42'
655
+ }
656
+ },
657
+ 'silent [[Prototype]] payload: plain objects'
658
+ );
659
+
660
+ var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true });
661
+
662
+ st.notOk(Array.isArray(query.categories), 'is not an array');
663
+ st.notOk(query.categories instanceof Array, 'is not instanceof an array');
664
+ st.deepEqual(query.categories, { some: { json: 'toInject' } });
665
+ st.equal(JSON.stringify(query.categories), '{"some":{"json":"toInject"}}', 'stringifies as a non-array');
666
+
667
+ st.deepEqual(
668
+ qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }),
669
+ {
670
+ foo: {
671
+ bar: 'stuffs'
672
+ }
673
+ },
674
+ 'hidden values'
675
+ );
676
+
677
+ st.deepEqual(
678
+ qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }),
679
+ {
680
+ __proto__: null,
681
+ foo: {
682
+ __proto__: null,
683
+ bar: 'stuffs'
684
+ }
685
+ },
686
+ 'hidden values: plain objects'
687
+ );
688
+
689
+ st.end();
690
+ });
691
+
632
692
  t.test('can return null objects', { skip: !Object.create }, function (st) {
633
693
  var expected = Object.create(null);
634
694
  expected.a = Object.create(null);
package/package.json CHANGED
@@ -46,10 +46,10 @@
46
46
  "eslint-plugin-import": "^2.25.4",
47
47
  "jest": "^27.4.7",
48
48
  "jest-junit": "^13",
49
- "jsii": "^1.52.0",
50
- "jsii-diff": "^1.52.0",
49
+ "jsii": "^1.52.1",
50
+ "jsii-diff": "^1.52.1",
51
51
  "jsii-docgen": "^3.8.31",
52
- "jsii-pacmak": "^1.52.0",
52
+ "jsii-pacmak": "^1.52.1",
53
53
  "json-schema": "^0.4.0",
54
54
  "npm-check-updates": "^12",
55
55
  "projen": "0.45.4",
@@ -62,7 +62,7 @@
62
62
  "constructs": "^10.0.5"
63
63
  },
64
64
  "dependencies": {
65
- "@aws-cdk/assert": "^2.4.0",
65
+ "@aws-cdk/assert": "^2.5.0",
66
66
  "case": "^1.6.3",
67
67
  "sync-request": "^6.1.0"
68
68
  },
@@ -80,7 +80,7 @@
80
80
  ],
81
81
  "main": "lib/index.js",
82
82
  "license": "Apache-2.0",
83
- "version": "2.0.32",
83
+ "version": "2.0.36",
84
84
  "jest": {
85
85
  "testMatch": [
86
86
  "**/__tests__/**/*.ts?(x)",
@@ -1,2 +0,0 @@
1
- dist/
2
- coverage/