cdk-common 2.0.493 → 2.0.495

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.
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [v1.2.1](https://github.com/ljharb/get-intrinsic/compare/v1.2.0...v1.2.1) - 2023-05-13
9
+
10
+ ### Commits
11
+
12
+ - [Fix] avoid a crash in envs without `__proto__` [`7bad8d0`](https://github.com/ljharb/get-intrinsic/commit/7bad8d061bf8721733b58b73a2565af2b6756b64)
13
+ - [Dev Deps] update `es-abstract` [`c60e6b7`](https://github.com/ljharb/get-intrinsic/commit/c60e6b7b4cf9660c7f27ed970970fd55fac48dc5)
14
+
8
15
  ## [v1.2.0](https://github.com/ljharb/get-intrinsic/compare/v1.1.3...v1.2.0) - 2023-01-19
9
16
 
10
17
  ### Commits
@@ -43,18 +43,23 @@ var ThrowTypeError = $gOPD
43
43
  : throwTypeError;
44
44
 
45
45
  var hasSymbols = require('has-symbols')();
46
+ var hasProto = require('has-proto')();
46
47
 
47
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
48
+ var getProto = Object.getPrototypeOf || (
49
+ hasProto
50
+ ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
51
+ : null
52
+ );
48
53
 
49
54
  var needsEval = {};
50
55
 
51
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
56
+ var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
52
57
 
53
58
  var INTRINSICS = {
54
59
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
55
60
  '%Array%': Array,
56
61
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
57
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
62
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
58
63
  '%AsyncFromSyncIteratorPrototype%': undefined,
59
64
  '%AsyncFunction%': needsEval,
60
65
  '%AsyncGenerator%': needsEval,
@@ -84,10 +89,10 @@ var INTRINSICS = {
84
89
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
85
90
  '%isFinite%': isFinite,
86
91
  '%isNaN%': isNaN,
87
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
92
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
88
93
  '%JSON%': typeof JSON === 'object' ? JSON : undefined,
89
94
  '%Map%': typeof Map === 'undefined' ? undefined : Map,
90
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
95
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
91
96
  '%Math%': Math,
92
97
  '%Number%': Number,
93
98
  '%Object%': Object,
@@ -100,10 +105,10 @@ var INTRINSICS = {
100
105
  '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
101
106
  '%RegExp%': RegExp,
102
107
  '%Set%': typeof Set === 'undefined' ? undefined : Set,
103
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
108
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
104
109
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
105
110
  '%String%': String,
106
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
111
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
107
112
  '%Symbol%': hasSymbols ? Symbol : undefined,
108
113
  '%SyntaxError%': $SyntaxError,
109
114
  '%ThrowTypeError%': ThrowTypeError,
@@ -119,12 +124,14 @@ var INTRINSICS = {
119
124
  '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
120
125
  };
121
126
 
122
- try {
123
- null.error; // eslint-disable-line no-unused-expressions
124
- } catch (e) {
125
- // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
126
- var errorProto = getProto(getProto(e));
127
- INTRINSICS['%Error.prototype%'] = errorProto;
127
+ if (getProto) {
128
+ try {
129
+ null.error; // eslint-disable-line no-unused-expressions
130
+ } catch (e) {
131
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
132
+ var errorProto = getProto(getProto(e));
133
+ INTRINSICS['%Error.prototype%'] = errorProto;
134
+ }
128
135
  }
129
136
 
130
137
  var doEval = function doEval(name) {
@@ -142,7 +149,7 @@ var doEval = function doEval(name) {
142
149
  }
143
150
  } else if (name === '%AsyncIteratorPrototype%') {
144
151
  var gen = doEval('%AsyncGenerator%');
145
- if (gen) {
152
+ if (gen && getProto) {
146
153
  value = getProto(gen.prototype);
147
154
  }
148
155
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "get-intrinsic",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Get and robustly cache all JS language-level intrinsics at first require time",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -52,7 +52,7 @@
52
52
  "aud": "^2.0.2",
53
53
  "auto-changelog": "^2.4.0",
54
54
  "call-bind": "^1.0.2",
55
- "es-abstract": "^1.21.1",
55
+ "es-abstract": "^1.21.2",
56
56
  "es-value-fixtures": "^1.4.2",
57
57
  "eslint": "=8.8.0",
58
58
  "evalmd": "^0.0.19",
@@ -79,6 +79,7 @@
79
79
  "dependencies": {
80
80
  "function-bind": "^1.1.1",
81
81
  "has": "^1.0.3",
82
+ "has-proto": "^1.0.1",
82
83
  "has-symbols": "^1.0.3"
83
84
  },
84
85
  "testling": {
@@ -0,0 +1,5 @@
1
+ {
2
+ "root": true,
3
+
4
+ "extends": "@ljharb",
5
+ }
@@ -0,0 +1,12 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [ljharb]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: npm/has-proto
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [v1.0.1](https://github.com/inspect-js/has-proto/compare/v1.0.0...v1.0.1) - 2022-12-21
9
+
10
+ ### Commits
11
+
12
+ - [meta] correct URLs and description [`ef34483`](https://github.com/inspect-js/has-proto/commit/ef34483ca0d35680f271b6b96e35526151b25dfc)
13
+ - [patch] add an additional criteria [`e81959e`](https://github.com/inspect-js/has-proto/commit/e81959ed7c7a77fbf459f00cb4ef824f1099497f)
14
+ - [Dev Deps] update `aud` [`2bec2c4`](https://github.com/inspect-js/has-proto/commit/2bec2c47b072b122ff5443fba0263f6dc649531f)
15
+
16
+ ## v1.0.0 - 2022-12-12
17
+
18
+ ### Commits
19
+
20
+ - Initial implementation, tests, readme [`6886fea`](https://github.com/inspect-js/has-proto/commit/6886fea578f67daf69a7920b2eb7637ea6ebb0bc)
21
+ - Initial commit [`99129c8`](https://github.com/inspect-js/has-proto/commit/99129c8f42471ac89cb681ba9cb9d52a583eb94f)
22
+ - npm init [`2844ad8`](https://github.com/inspect-js/has-proto/commit/2844ad8e75b84d66a46765b3bab9d2e8ea692e10)
23
+ - Only apps should have lockfiles [`c65bc5e`](https://github.com/inspect-js/has-proto/commit/c65bc5e40b9004463f7336d47c67245fb139a36a)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Inspect JS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,38 @@
1
+ # has-proto <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
2
+
3
+ [![github actions][actions-image]][actions-url]
4
+ [![coverage][codecov-image]][codecov-url]
5
+ [![License][license-image]][license-url]
6
+ [![Downloads][downloads-image]][downloads-url]
7
+
8
+ [![npm badge][npm-badge-png]][package-url]
9
+
10
+ Does this environment have the ability to set the [[Prototype]] of an object on creation with `__proto__`?
11
+
12
+ ## Example
13
+
14
+ ```js
15
+ var hasProto = require('has-proto');
16
+ var assert = require('assert');
17
+
18
+ assert.equal(typeof hasProto(), 'boolean');
19
+ ```
20
+
21
+ ## Tests
22
+ Simply clone the repo, `npm install`, and run `npm test`
23
+
24
+ [package-url]: https://npmjs.org/package/has-proto
25
+ [npm-version-svg]: https://versionbadg.es/inspect-js/has-proto.svg
26
+ [deps-svg]: https://david-dm.org/inspect-js/has-proto.svg
27
+ [deps-url]: https://david-dm.org/inspect-js/has-proto
28
+ [dev-deps-svg]: https://david-dm.org/inspect-js/has-proto/dev-status.svg
29
+ [dev-deps-url]: https://david-dm.org/inspect-js/has-proto#info=devDependencies
30
+ [npm-badge-png]: https://nodei.co/npm/has-proto.png?downloads=true&stars=true
31
+ [license-image]: https://img.shields.io/npm/l/has-proto.svg
32
+ [license-url]: LICENSE
33
+ [downloads-image]: https://img.shields.io/npm/dm/has-proto.svg
34
+ [downloads-url]: https://npm-stat.com/charts.html?package=has-proto
35
+ [codecov-image]: https://codecov.io/gh/inspect-js/has-proto/branch/main/graphs/badge.svg
36
+ [codecov-url]: https://app.codecov.io/gh/inspect-js/has-proto/
37
+ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-proto
38
+ [actions-url]: https://github.com/inspect-js/has-proto/actions
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var test = {
4
+ foo: {}
5
+ };
6
+
7
+ var $Object = Object;
8
+
9
+ module.exports = function hasProto() {
10
+ return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
11
+ };
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "has-proto",
3
+ "version": "1.0.1",
4
+ "description": "Does this environment have the ability to get the [[Prototype]] of an object on creation with `__proto__`?",
5
+ "main": "index.js",
6
+ "exports": {
7
+ ".": "./index.js",
8
+ "./package.json": "./package.json"
9
+ },
10
+ "scripts": {
11
+ "prepack": "npmignore --auto --commentLines=autogenerated",
12
+ "prepublishOnly": "safe-publish-latest",
13
+ "prepublish": "not-in-publish || npm run prepublishOnly",
14
+ "lint": "eslint --ext=js,mjs .",
15
+ "pretest": "npm run lint",
16
+ "tests-only": "tape 'test/**/*.js'",
17
+ "test": "npm run tests-only",
18
+ "posttest": "aud --production",
19
+ "version": "auto-changelog && git add CHANGELOG.md",
20
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/inspect-js/has-proto.git"
25
+ },
26
+ "keywords": [
27
+ "prototype",
28
+ "proto",
29
+ "set",
30
+ "get",
31
+ "__proto__",
32
+ "getPrototypeOf",
33
+ "setPrototypeOf",
34
+ "has"
35
+ ],
36
+ "author": "Jordan Harband <ljharb@gmail.com>",
37
+ "funding": {
38
+ "url": "https://github.com/sponsors/ljharb"
39
+ },
40
+ "license": "MIT",
41
+ "bugs": {
42
+ "url": "https://github.com/inspect-js/has-proto/issues"
43
+ },
44
+ "homepage": "https://github.com/inspect-js/has-proto#readme",
45
+ "testling": {
46
+ "files": "test/index.js"
47
+ },
48
+ "devDependencies": {
49
+ "@ljharb/eslint-config": "^21.0.0",
50
+ "aud": "^2.0.2",
51
+ "auto-changelog": "^2.4.0",
52
+ "eslint": "=8.8.0",
53
+ "in-publish": "^2.0.1",
54
+ "npmignore": "^0.3.0",
55
+ "safe-publish-latest": "^2.0.0",
56
+ "tape": "^5.6.1"
57
+ },
58
+ "engines": {
59
+ "node": ">= 0.4"
60
+ },
61
+ "auto-changelog": {
62
+ "output": "CHANGELOG.md",
63
+ "template": "keepachangelog",
64
+ "unreleased": false,
65
+ "commitLimit": false,
66
+ "backfillLimit": false,
67
+ "hideCredit": true
68
+ },
69
+ "publishConfig": {
70
+ "ignore": [
71
+ ".github/workflows"
72
+ ]
73
+ }
74
+ }
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var test = require('tape');
4
+ var hasProto = require('../');
5
+
6
+ test('hasProto', function (t) {
7
+ var result = hasProto();
8
+ t.equal(typeof result, 'boolean', 'returns a boolean (' + result + ')');
9
+
10
+ var obj = { __proto__: null };
11
+ if (result) {
12
+ t.notOk('toString' in obj, 'null object lacks toString');
13
+ } else {
14
+ t.ok('toString' in obj, 'without proto, null object has toString');
15
+ t.equal(obj.__proto__, null); // eslint-disable-line no-proto
16
+ }
17
+
18
+ t.end();
19
+ });
@@ -1,3 +1,7 @@
1
+ ## **6.11.2**
2
+ - [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473)
3
+ - [Tests] add passing test cases with empty keys (#473)
4
+
1
5
  ## **6.11.1**
2
6
  - [Fix] `stringify`: encode comma values more consistently (#463)
3
7
  - [readme] add usage of `filter` option for injecting custom serialization, i.e. of custom types (#447)
@@ -88,7 +88,8 @@ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
88
88
  var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
89
89
 
90
90
  var parseValues = function parseQueryStringValues(str, options) {
91
- var obj = {};
91
+ var obj = { __proto__: null };
92
+
92
93
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
93
94
  var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
94
95
  var parts = cleanStr.split(options.delimiter, limit);
@@ -623,7 +624,7 @@ module.exports = function (object, opts) {
623
624
  return joined.length > 0 ? prefix + joined : '';
624
625
  };
625
626
 
626
- },{"./formats":1,"./utils":5,"side-channel":16}],5:[function(require,module,exports){
627
+ },{"./formats":1,"./utils":5,"side-channel":17}],5:[function(require,module,exports){
627
628
  'use strict';
628
629
 
629
630
  var formats = require('./formats');
@@ -1052,18 +1053,23 @@ var ThrowTypeError = $gOPD
1052
1053
  : throwTypeError;
1053
1054
 
1054
1055
  var hasSymbols = require('has-symbols')();
1056
+ var hasProto = require('has-proto')();
1055
1057
 
1056
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
1058
+ var getProto = Object.getPrototypeOf || (
1059
+ hasProto
1060
+ ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
1061
+ : null
1062
+ );
1057
1063
 
1058
1064
  var needsEval = {};
1059
1065
 
1060
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
1066
+ var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
1061
1067
 
1062
1068
  var INTRINSICS = {
1063
1069
  '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
1064
1070
  '%Array%': Array,
1065
1071
  '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
1066
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
1072
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
1067
1073
  '%AsyncFromSyncIteratorPrototype%': undefined,
1068
1074
  '%AsyncFunction%': needsEval,
1069
1075
  '%AsyncGenerator%': needsEval,
@@ -1093,10 +1099,10 @@ var INTRINSICS = {
1093
1099
  '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
1094
1100
  '%isFinite%': isFinite,
1095
1101
  '%isNaN%': isNaN,
1096
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
1102
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
1097
1103
  '%JSON%': typeof JSON === 'object' ? JSON : undefined,
1098
1104
  '%Map%': typeof Map === 'undefined' ? undefined : Map,
1099
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
1105
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
1100
1106
  '%Math%': Math,
1101
1107
  '%Number%': Number,
1102
1108
  '%Object%': Object,
@@ -1109,10 +1115,10 @@ var INTRINSICS = {
1109
1115
  '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
1110
1116
  '%RegExp%': RegExp,
1111
1117
  '%Set%': typeof Set === 'undefined' ? undefined : Set,
1112
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
1118
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
1113
1119
  '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
1114
1120
  '%String%': String,
1115
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
1121
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
1116
1122
  '%Symbol%': hasSymbols ? Symbol : undefined,
1117
1123
  '%SyntaxError%': $SyntaxError,
1118
1124
  '%ThrowTypeError%': ThrowTypeError,
@@ -1128,12 +1134,14 @@ var INTRINSICS = {
1128
1134
  '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
1129
1135
  };
1130
1136
 
1131
- try {
1132
- null.error; // eslint-disable-line no-unused-expressions
1133
- } catch (e) {
1134
- // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
1135
- var errorProto = getProto(getProto(e));
1136
- INTRINSICS['%Error.prototype%'] = errorProto;
1137
+ if (getProto) {
1138
+ try {
1139
+ null.error; // eslint-disable-line no-unused-expressions
1140
+ } catch (e) {
1141
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
1142
+ var errorProto = getProto(getProto(e));
1143
+ INTRINSICS['%Error.prototype%'] = errorProto;
1144
+ }
1137
1145
  }
1138
1146
 
1139
1147
  var doEval = function doEval(name) {
@@ -1151,7 +1159,7 @@ var doEval = function doEval(name) {
1151
1159
  }
1152
1160
  } else if (name === '%AsyncIteratorPrototype%') {
1153
1161
  var gen = doEval('%AsyncGenerator%');
1154
- if (gen) {
1162
+ if (gen && getProto) {
1155
1163
  value = getProto(gen.prototype);
1156
1164
  }
1157
1165
  }
@@ -1352,7 +1360,20 @@ module.exports = function GetIntrinsic(name, allowMissing) {
1352
1360
  return value;
1353
1361
  };
1354
1362
 
1355
- },{"function-bind":10,"has":14,"has-symbols":12}],12:[function(require,module,exports){
1363
+ },{"function-bind":10,"has":15,"has-proto":12,"has-symbols":13}],12:[function(require,module,exports){
1364
+ 'use strict';
1365
+
1366
+ var test = {
1367
+ foo: {}
1368
+ };
1369
+
1370
+ var $Object = Object;
1371
+
1372
+ module.exports = function hasProto() {
1373
+ return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
1374
+ };
1375
+
1376
+ },{}],13:[function(require,module,exports){
1356
1377
  'use strict';
1357
1378
 
1358
1379
  var origSymbol = typeof Symbol !== 'undefined' && Symbol;
@@ -1367,7 +1388,7 @@ module.exports = function hasNativeSymbols() {
1367
1388
  return hasSymbolSham();
1368
1389
  };
1369
1390
 
1370
- },{"./shams":13}],13:[function(require,module,exports){
1391
+ },{"./shams":14}],14:[function(require,module,exports){
1371
1392
  'use strict';
1372
1393
 
1373
1394
  /* eslint complexity: [2, 18], max-statements: [2, 33] */
@@ -1411,14 +1432,14 @@ module.exports = function hasSymbols() {
1411
1432
  return true;
1412
1433
  };
1413
1434
 
1414
- },{}],14:[function(require,module,exports){
1435
+ },{}],15:[function(require,module,exports){
1415
1436
  'use strict';
1416
1437
 
1417
1438
  var bind = require('function-bind');
1418
1439
 
1419
1440
  module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
1420
1441
 
1421
- },{"function-bind":10}],15:[function(require,module,exports){
1442
+ },{"function-bind":10}],16:[function(require,module,exports){
1422
1443
  var hasMap = typeof Map === 'function' && Map.prototype;
1423
1444
  var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
1424
1445
  var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
@@ -1936,7 +1957,7 @@ function arrObjKeys(obj, inspect) {
1936
1957
  return xs;
1937
1958
  }
1938
1959
 
1939
- },{"./util.inspect":6}],16:[function(require,module,exports){
1960
+ },{"./util.inspect":6}],17:[function(require,module,exports){
1940
1961
  'use strict';
1941
1962
 
1942
1963
  var GetIntrinsic = require('get-intrinsic');
@@ -2062,5 +2083,5 @@ module.exports = function getSideChannel() {
2062
2083
  return channel;
2063
2084
  };
2064
2085
 
2065
- },{"call-bind/callBound":7,"get-intrinsic":11,"object-inspect":15}]},{},[2])(2)
2086
+ },{"call-bind/callBound":7,"get-intrinsic":11,"object-inspect":16}]},{},[2])(2)
2066
2087
  });
@@ -49,7 +49,8 @@ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
49
49
  var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
50
50
 
51
51
  var parseValues = function parseQueryStringValues(str, options) {
52
- var obj = {};
52
+ var obj = { __proto__: null };
53
+
53
54
  var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
54
55
  var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
55
56
  var parts = cleanStr.split(options.delimiter, limit);
@@ -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.11.1",
5
+ "version": "6.11.2",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/ljharb/qs.git"
@@ -40,10 +40,13 @@
40
40
  "eslint": "=8.8.0",
41
41
  "evalmd": "^0.0.19",
42
42
  "for-each": "^0.3.3",
43
+ "has-override-mistake": "^1.0.0",
44
+ "has-property-descriptors": "^1.0.0",
43
45
  "has-symbols": "^1.0.3",
44
46
  "iconv-lite": "^0.5.1",
45
47
  "in-publish": "^2.0.1",
46
48
  "mkdirp": "^0.5.5",
49
+ "mock-property": "^1.0.0",
47
50
  "npmignore": "^0.3.0",
48
51
  "nyc": "^10.3.2",
49
52
  "object-inspect": "^1.12.3",
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ emptyTestCases: [
5
+ { input: '&', withEmptyKeys: {}, stringifyOutput: '', noEmptyKeys: {} },
6
+ { input: '&&', withEmptyKeys: {}, stringifyOutput: '', noEmptyKeys: {} },
7
+ { input: '&=', withEmptyKeys: { '': '' }, stringifyOutput: '=', noEmptyKeys: {} },
8
+ { input: '&=&', withEmptyKeys: { '': '' }, stringifyOutput: '=', noEmptyKeys: {} },
9
+ { input: '&=&=', withEmptyKeys: { '': ['', ''] }, stringifyOutput: '[0]=&[1]=', noEmptyKeys: {} },
10
+ { input: '&=&=&', withEmptyKeys: { '': ['', ''] }, stringifyOutput: '[0]=&[1]=', noEmptyKeys: {} },
11
+
12
+ { input: '=', withEmptyKeys: { '': '' }, noEmptyKeys: {}, stringifyOutput: '=' },
13
+ { input: '=&', withEmptyKeys: { '': '' }, stringifyOutput: '=', noEmptyKeys: {} },
14
+ { input: '=&&&', withEmptyKeys: { '': '' }, stringifyOutput: '=', noEmptyKeys: {} },
15
+ { input: '=&=&=&', withEmptyKeys: { '': ['', '', ''] }, stringifyOutput: '[0]=&[1]=&[2]=', noEmptyKeys: {} },
16
+ { input: '=&a[]=b&a[1]=c', withEmptyKeys: { '': '', a: ['b', 'c'] }, stringifyOutput: '=&a[0]=b&a[1]=c', noEmptyKeys: { a: ['b', 'c'] } },
17
+ { input: '=a', withEmptyKeys: { '': 'a' }, noEmptyKeys: {}, stringifyOutput: '=a' },
18
+ { input: '=a', withEmptyKeys: { '': 'a' }, noEmptyKeys: {}, stringifyOutput: '=a' },
19
+ { input: 'a==a', withEmptyKeys: { a: '=a' }, noEmptyKeys: { a: '=a' }, stringifyOutput: 'a==a' },
20
+
21
+ { input: '=&a[]=b', withEmptyKeys: { '': '', a: ['b'] }, stringifyOutput: '=&a[0]=b', noEmptyKeys: { a: ['b'] } },
22
+ { input: '=&a[]=b&a[]=c&a[2]=d', withEmptyKeys: { '': '', a: ['b', 'c', 'd'] }, stringifyOutput: '=&a[0]=b&a[1]=c&a[2]=d', noEmptyKeys: { a: ['b', 'c', 'd'] } },
23
+ { input: '=a&=b', withEmptyKeys: { '': ['a', 'b'] }, stringifyOutput: '[0]=a&[1]=b', noEmptyKeys: {} },
24
+ { input: '=a&foo=b', withEmptyKeys: { '': 'a', foo: 'b' }, noEmptyKeys: { foo: 'b' }, stringifyOutput: '=a&foo=b' },
25
+
26
+ { input: 'a[]=b&a=c&=', withEmptyKeys: { '': '', a: ['b', 'c'] }, stringifyOutput: '=&a[0]=b&a[1]=c', noEmptyKeys: { a: ['b', 'c'] } },
27
+ { input: 'a[]=b&a=c&=', withEmptyKeys: { '': '', a: ['b', 'c'] }, stringifyOutput: '=&a[0]=b&a[1]=c', noEmptyKeys: { a: ['b', 'c'] } },
28
+ { input: 'a[0]=b&a=c&=', withEmptyKeys: { '': '', a: ['b', 'c'] }, stringifyOutput: '=&a[0]=b&a[1]=c', noEmptyKeys: { a: ['b', 'c'] } },
29
+ { input: 'a=b&a[]=c&=', withEmptyKeys: { '': '', a: ['b', 'c'] }, stringifyOutput: '=&a[0]=b&a[1]=c', noEmptyKeys: { a: ['b', 'c'] } },
30
+ { input: 'a=b&a[0]=c&=', withEmptyKeys: { '': '', a: ['b', 'c'] }, stringifyOutput: '=&a[0]=b&a[1]=c', noEmptyKeys: { a: ['b', 'c'] } },
31
+
32
+ { input: '[]=a&[]=b& []=1', withEmptyKeys: { '': ['a', 'b'], ' ': ['1'] }, stringifyOutput: '[0]=a&[1]=b& [0]=1', noEmptyKeys: { 0: 'a', 1: 'b', ' ': ['1'] } },
33
+ { input: '[0]=a&[1]=b&a[0]=1&a[1]=2', withEmptyKeys: { '': ['a', 'b'], a: ['1', '2'] }, noEmptyKeys: { 0: 'a', 1: 'b', a: ['1', '2'] }, stringifyOutput: '[0]=a&[1]=b&a[0]=1&a[1]=2' },
34
+ { input: '[deep]=a&[deep]=2', withEmptyKeys: { '': { deep: ['a', '2'] } }, stringifyOutput: '[deep][0]=a&[deep][1]=2', noEmptyKeys: { deep: ['a', '2'] } },
35
+ { input: '%5B0%5D=a&%5B1%5D=b', withEmptyKeys: { '': ['a', 'b'] }, stringifyOutput: '[0]=a&[1]=b', noEmptyKeys: { 0: 'a', 1: 'b' } }
36
+ ]
37
+ };
@@ -1,10 +1,15 @@
1
1
  'use strict';
2
2
 
3
3
  var test = require('tape');
4
- var qs = require('../');
5
- var utils = require('../lib/utils');
4
+ var hasPropertyDescriptors = require('has-property-descriptors')();
6
5
  var iconv = require('iconv-lite');
6
+ var mockProperty = require('mock-property');
7
+ var hasOverrideMistake = require('has-override-mistake')();
7
8
  var SaferBuffer = require('safer-buffer').Buffer;
9
+ var emptyTestCases = require('./empty-keys-cases').emptyTestCases;
10
+
11
+ var qs = require('../');
12
+ var utils = require('../lib/utils');
8
13
 
9
14
  test('parse()', function (t) {
10
15
  t.test('parses a simple string', function (st) {
@@ -601,6 +606,34 @@ test('parse()', function (t) {
601
606
  st.end();
602
607
  });
603
608
 
609
+ t.test('does not crash when the global Object prototype is frozen', { skip: !hasPropertyDescriptors || !hasOverrideMistake }, function (st) {
610
+ // We can't actually freeze the global Object prototype as that will interfere with other tests, and once an object is frozen, it
611
+ // can't be unfrozen. Instead, we add a new non-writable property to simulate this.
612
+ st.teardown(mockProperty(Object.prototype, 'frozenProp', { value: 'foo', nonWritable: true, nonEnumerable: true }));
613
+
614
+ st['throws'](
615
+ function () {
616
+ var obj = {};
617
+ obj.frozenProp = 'bar';
618
+ },
619
+ // node < 6 has a different error message
620
+ /^TypeError: Cannot assign to read only property 'frozenProp' of (?:object '#<Object>'|#<Object>)/,
621
+ 'regular assignment of an inherited non-writable property throws'
622
+ );
623
+
624
+ var parsed;
625
+ st.doesNotThrow(
626
+ function () {
627
+ parsed = qs.parse('frozenProp', { allowPrototypes: false });
628
+ },
629
+ 'parsing a nonwritable Object.prototype property does not throw'
630
+ );
631
+
632
+ st.deepEqual(parsed, {}, 'bare "frozenProp" results in {}');
633
+
634
+ st.end();
635
+ });
636
+
604
637
  t.test('params starting with a closing bracket', function (st) {
605
638
  st.deepEqual(qs.parse(']=toString'), { ']': 'toString' });
606
639
  st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' });
@@ -853,3 +886,13 @@ test('parse()', function (t) {
853
886
 
854
887
  t.end();
855
888
  });
889
+
890
+ test('parses empty keys', function (t) {
891
+ emptyTestCases.forEach(function (testCase) {
892
+ t.test('skips empty string key with ' + testCase.input, function (st) {
893
+ st.deepEqual(qs.parse(testCase.input), testCase.noEmptyKeys);
894
+
895
+ st.end();
896
+ });
897
+ });
898
+ });