@arokodev/cli 0.1.0-alpha.5 → 0.1.0-alpha.8

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 (167) hide show
  1. package/node_modules/@pairmesh/client/dist/build-info.generated.d.ts +12 -12
  2. package/node_modules/@pairmesh/client/dist/build-info.generated.js +6 -6
  3. package/node_modules/@pairmesh/client/dist/connectivity/relay/hosted-server.js +1 -1
  4. package/node_modules/@pairmesh/client/dist/session/schemas.d.ts +10 -10
  5. package/node_modules/@pairmesh/client/dist/session/schemas.d.ts.map +1 -1
  6. package/node_modules/@pairmesh/client/package.json +5 -5
  7. package/node_modules/@pairmesh/coordination/package.json +5 -5
  8. package/node_modules/@pairmesh/mcp/package.json +5 -5
  9. package/node_modules/@pairmesh/permissions/package.json +2 -2
  10. package/node_modules/@pairmesh/protocol/dist/action.d.ts +1 -1
  11. package/node_modules/@pairmesh/protocol/dist/inspection-execution.d.ts +1 -1
  12. package/node_modules/@pairmesh/protocol/dist/inspection-thread.d.ts +1 -1
  13. package/node_modules/@pairmesh/protocol/dist/inspection-thread.d.ts.map +1 -1
  14. package/node_modules/@pairmesh/protocol/dist/inspection.d.ts +2 -2
  15. package/node_modules/@pairmesh/protocol/dist/pairing.d.ts +1 -1
  16. package/node_modules/@pairmesh/protocol/dist/progress-event.d.ts +1 -1
  17. package/node_modules/@pairmesh/protocol/dist/progress-event.d.ts.map +1 -1
  18. package/node_modules/@pairmesh/protocol/package.json +2 -2
  19. package/node_modules/@pairmesh/shared/package.json +1 -1
  20. package/node_modules/body-parser/README.md +17 -13
  21. package/node_modules/body-parser/lib/read.js +74 -57
  22. package/node_modules/body-parser/lib/types/json.js +11 -11
  23. package/node_modules/body-parser/lib/types/urlencoded.js +5 -5
  24. package/node_modules/body-parser/lib/utils.js +0 -15
  25. package/node_modules/body-parser/package.json +7 -12
  26. package/node_modules/encodeurl/README.md +14 -0
  27. package/node_modules/encodeurl/index.js +9 -11
  28. package/node_modules/encodeurl/package.json +13 -6
  29. package/node_modules/jose/README.md +2 -2
  30. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +5 -4
  31. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +4 -4
  32. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +5 -4
  33. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +5 -5
  34. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +5 -4
  35. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +5 -5
  36. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -4
  37. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +5 -5
  38. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -4
  39. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +6 -5
  40. package/node_modules/jose/dist/types/jws/general/sign.d.ts +9 -6
  41. package/node_modules/jose/dist/types/jws/general/verify.d.ts +7 -5
  42. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +10 -6
  43. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +1 -1
  44. package/node_modules/jose/dist/types/jwt/sign.d.ts +1 -1
  45. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +3 -1
  46. package/node_modules/jose/dist/types/jwt/verify.d.ts +6 -5
  47. package/node_modules/jose/dist/types/key/export.d.ts +1 -1
  48. package/node_modules/jose/dist/types/key/generate_secret.d.ts +1 -1
  49. package/node_modules/jose/dist/types/key/import.d.ts +2 -2
  50. package/node_modules/jose/dist/types/types.d.ts +173 -107
  51. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +3 -2
  52. package/node_modules/jose/dist/types/util/errors.d.ts +1 -1
  53. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +3 -2
  54. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +3 -3
  55. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +8 -8
  56. package/node_modules/jose/dist/webapi/jwks/local.js +2 -1
  57. package/node_modules/jose/dist/webapi/jwks/remote.js +6 -4
  58. package/node_modules/jose/dist/webapi/jws/general/sign.js +3 -3
  59. package/node_modules/jose/dist/webapi/jws/general/verify.js +5 -11
  60. package/node_modules/jose/dist/webapi/jwt/encrypt.js +6 -9
  61. package/node_modules/jose/dist/webapi/jwt/sign.js +2 -2
  62. package/node_modules/jose/dist/webapi/jwt/unsecured.js +3 -3
  63. package/node_modules/jose/dist/webapi/key/generate_secret.js +4 -4
  64. package/node_modules/jose/dist/webapi/lib/asn1.js +2 -2
  65. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +4 -4
  66. package/node_modules/jose/dist/webapi/lib/content_encryption.js +8 -8
  67. package/node_modules/jose/dist/webapi/lib/deflate.js +2 -1
  68. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +26 -23
  69. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +5 -5
  70. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +2 -2
  71. package/node_modules/jose/dist/webapi/lib/jws_sign.js +11 -11
  72. package/node_modules/jose/dist/webapi/lib/jws_verify.js +19 -16
  73. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +48 -44
  74. package/node_modules/jose/dist/webapi/lib/key.js +6 -4
  75. package/node_modules/jose/dist/webapi/lib/key_management.js +17 -18
  76. package/node_modules/jose/dist/webapi/lib/validate.js +10 -10
  77. package/node_modules/jose/dist/webapi/util/decode_jwt.js +12 -12
  78. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -5
  79. package/node_modules/jose/package.json +1 -1
  80. package/node_modules/object-inspect/CHANGELOG.md +31 -0
  81. package/node_modules/object-inspect/index.js +326 -24
  82. package/node_modules/object-inspect/package.json +22 -13
  83. package/node_modules/object-inspect/readme.markdown +4 -1
  84. package/node_modules/object-inspect/stringWidth.js +68 -0
  85. package/node_modules/object-inspect/stringWidthRanges.js +38 -0
  86. package/node_modules/on-finished/index.js +14 -2
  87. package/node_modules/on-finished/package.json +11 -7
  88. package/node_modules/qs/.editorconfig +1 -1
  89. package/node_modules/qs/.github/THREAT_MODEL.md +4 -2
  90. package/node_modules/qs/CHANGELOG.md +103 -14
  91. package/node_modules/qs/README.md +90 -9
  92. package/node_modules/qs/dist/qs.js +19 -19
  93. package/node_modules/qs/eslint.config.mjs +61 -50
  94. package/node_modules/qs/lib/formats.js +7 -2
  95. package/node_modules/qs/lib/parse.js +121 -12
  96. package/node_modules/qs/lib/stringify.js +9 -7
  97. package/node_modules/qs/lib/utils.js +158 -15
  98. package/node_modules/qs/package.json +8 -8
  99. package/node_modules/qs/test/parse.js +509 -2
  100. package/node_modules/qs/test/stringify.js +485 -33
  101. package/node_modules/qs/test/utils.js +245 -3
  102. package/node_modules/router/HISTORY.md +67 -52
  103. package/node_modules/router/README.md +222 -2
  104. package/node_modules/router/index.d.ts +188 -0
  105. package/node_modules/router/index.js +86 -50
  106. package/node_modules/router/lib/layer.js +154 -47
  107. package/node_modules/router/lib/param.js +47 -0
  108. package/node_modules/router/lib/route.d.ts +118 -0
  109. package/node_modules/router/lib/route.js +14 -8
  110. package/node_modules/router/lib/symbols.js +4 -0
  111. package/node_modules/router/lib/tracing.js +173 -0
  112. package/node_modules/router/package.json +24 -9
  113. package/node_modules/ws/README.md +22 -31
  114. package/node_modules/ws/lib/buffer-util.js +13 -2
  115. package/node_modules/ws/lib/receiver.js +8 -0
  116. package/node_modules/ws/lib/sender.js +4 -1
  117. package/node_modules/ws/lib/websocket-server.js +3 -0
  118. package/node_modules/ws/lib/websocket.js +66 -16
  119. package/node_modules/ws/package.json +1 -1
  120. package/node_modules/zod/package.json +1 -1
  121. package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  122. package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  123. package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  124. package/node_modules/zod/src/v4/core/compile.ts +9 -0
  125. package/node_modules/zod/src/v4/core/schemas.ts +35 -1
  126. package/node_modules/zod/src/v4/core/util.ts +13 -0
  127. package/node_modules/zod/src/v4/core/versions.ts +1 -1
  128. package/node_modules/zod/v4/core/compile.cjs +8 -0
  129. package/node_modules/zod/v4/core/compile.js +8 -0
  130. package/node_modules/zod/v4/core/schemas.cjs +30 -0
  131. package/node_modules/zod/v4/core/schemas.d.cts +3 -1
  132. package/node_modules/zod/v4/core/schemas.d.ts +3 -1
  133. package/node_modules/zod/v4/core/schemas.js +30 -0
  134. package/node_modules/zod/v4/core/util.cjs +15 -0
  135. package/node_modules/zod/v4/core/util.d.cts +2 -0
  136. package/node_modules/zod/v4/core/util.d.ts +2 -0
  137. package/node_modules/zod/v4/core/util.js +14 -0
  138. package/node_modules/zod/v4/core/versions.cjs +1 -1
  139. package/node_modules/zod/v4/core/versions.js +1 -1
  140. package/package.json +7 -7
  141. package/node_modules/object-inspect/.eslintrc +0 -53
  142. package/node_modules/object-inspect/.nycrc +0 -13
  143. package/node_modules/object-inspect/example/all.js +0 -23
  144. package/node_modules/object-inspect/example/circular.js +0 -6
  145. package/node_modules/object-inspect/example/fn.js +0 -5
  146. package/node_modules/object-inspect/example/inspect.js +0 -10
  147. package/node_modules/object-inspect/test/bigint.js +0 -58
  148. package/node_modules/object-inspect/test/browser/dom.js +0 -15
  149. package/node_modules/object-inspect/test/circular.js +0 -16
  150. package/node_modules/object-inspect/test/deep.js +0 -12
  151. package/node_modules/object-inspect/test/element.js +0 -53
  152. package/node_modules/object-inspect/test/err.js +0 -48
  153. package/node_modules/object-inspect/test/fakes.js +0 -29
  154. package/node_modules/object-inspect/test/fn.js +0 -76
  155. package/node_modules/object-inspect/test/global.js +0 -17
  156. package/node_modules/object-inspect/test/has.js +0 -15
  157. package/node_modules/object-inspect/test/holes.js +0 -15
  158. package/node_modules/object-inspect/test/indent-option.js +0 -271
  159. package/node_modules/object-inspect/test/inspect.js +0 -139
  160. package/node_modules/object-inspect/test/lowbyte.js +0 -12
  161. package/node_modules/object-inspect/test/number.js +0 -58
  162. package/node_modules/object-inspect/test/quoteStyle.js +0 -26
  163. package/node_modules/object-inspect/test/toStringTag.js +0 -40
  164. package/node_modules/object-inspect/test/undef.js +0 -12
  165. package/node_modules/object-inspect/test/values.js +0 -261
  166. package/node_modules/object-inspect/test-core-js.js +0 -26
  167. package/node_modules/on-finished/HISTORY.md +0 -98
@@ -150,10 +150,10 @@ var stringify = function stringify(
150
150
  // we need to join elements in
151
151
  if (encodeValuesOnly && encoder) {
152
152
  obj = utils.maybeMap(obj, function (v) {
153
- return v == null ? v : encoder(v);
153
+ return v == null ? v : encoder(v, defaults.encoder, charset, 'value', format);
154
154
  });
155
155
  }
156
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
156
+ objKeys = [{ value: obj.length > 0 ? utils.toCoercible(obj).join(',') || null : void undefined }];
157
157
  } else if (isArray(filter)) {
158
158
  objKeys = filter;
159
159
  } else {
@@ -161,12 +161,12 @@ var stringify = function stringify(
161
161
  objKeys = sort ? keys.sort(sort) : keys;
162
162
  }
163
163
 
164
- var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
164
+ var encodedPrefix = String(prefix);
165
165
 
166
166
  var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
167
167
 
168
168
  if (allowEmptyArrays && isArray(obj) && obj.length === 0 && Object.keys(obj).length === 0) {
169
- return adjustedPrefix + '[]';
169
+ return formatter(encoder && !encodeValuesOnly ? encoder(adjustedPrefix, defaults.encoder, charset, 'key', format) : adjustedPrefix) + '[]';
170
170
  }
171
171
 
172
172
  for (var j = 0; j < objKeys.length; ++j) {
@@ -251,7 +251,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
251
251
  }
252
252
 
253
253
  var arrayFormat;
254
- if (opts.arrayFormat in arrayPrefixGenerators) {
254
+ if (has.call(arrayPrefixGenerators, opts.arrayFormat)) {
255
255
  arrayFormat = opts.arrayFormat;
256
256
  } else if ('indices' in opts) {
257
257
  arrayFormat = opts.indices ? 'indices' : 'repeat';
@@ -300,7 +300,9 @@ module.exports = function (object, opts) {
300
300
  filter = options.filter;
301
301
  obj = filter('', obj);
302
302
  } else if (isArray(options.filter)) {
303
- filter = options.filter;
303
+ // a copy: `sort` below must not reorder the caller's array, and nested
304
+ // levels take their key order from the sorted copy
305
+ filter = options.filter.slice();
304
306
  objKeys = filter;
305
307
  }
306
308
 
@@ -347,7 +349,7 @@ module.exports = function (object, opts) {
347
349
  options.skipNulls,
348
350
  options.encodeDotInKeys,
349
351
  options.encode ? options.encoder : null,
350
- options.filter,
352
+ filter,
351
353
  options.sort,
352
354
  options.allowDots,
353
355
  options.serializeDate,
@@ -28,6 +28,23 @@ var setMaxIndex = function setMaxIndex(obj, maxIndex) {
28
28
  overflowChannel.set(obj, maxIndex);
29
29
  };
30
30
 
31
+ // Track containers produced by a `strictMerge` conflict wrap, and their current max numeric index,
32
+ // so repeated conflicts on one path append instead of nesting a new wrapper each time
33
+ var conflictChannel = getSideChannel();
34
+
35
+ var markConflict = function markConflict(obj, maxIndex) {
36
+ conflictChannel.set(obj, maxIndex);
37
+ return obj;
38
+ };
39
+
40
+ var isConflict = function isConflict(obj) {
41
+ return conflictChannel.has(obj);
42
+ };
43
+
44
+ var getConflictIndex = function getConflictIndex(obj) {
45
+ return conflictChannel.get(obj);
46
+ };
47
+
31
48
  var hexTable = (function () {
32
49
  var array = [];
33
50
  for (var i = 0; i < 256; ++i) {
@@ -80,6 +97,41 @@ var setProperty = function setProperty(obj, key, value) {
80
97
  }
81
98
  };
82
99
 
100
+ var maxNumericIndex = function maxNumericIndex(obj, min) {
101
+ var max = min;
102
+ var keys = Object.keys(obj);
103
+ for (var i = 0; i < keys.length; ++i) {
104
+ var num = parseInt(keys[i], 10);
105
+ if (String(num) === keys[i] && num > max) {
106
+ max = num;
107
+ }
108
+ }
109
+
110
+ return max;
111
+ };
112
+
113
+ // parsed arrays stay sparse until `compact`, so `length` would count the holes left by indices like `a[19]`
114
+ var countElements = function countElements(arr) {
115
+ var count = 0;
116
+ for (var i = 0; i < arr.length; ++i) {
117
+ if (has.call(arr, i)) {
118
+ count += 1;
119
+ }
120
+ }
121
+ return count;
122
+ };
123
+
124
+ var limitedPair = function limitedPair(first, second, options) {
125
+ var pair = [first, second];
126
+ if (options && typeof options.arrayLimit === 'number' && pair.length > options.arrayLimit) {
127
+ if (options.throwOnLimitExceeded) {
128
+ throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
129
+ }
130
+ return markOverflow(arrayToObject(pair, options), 1);
131
+ }
132
+ return pair;
133
+ };
134
+
83
135
  var merge = function merge(target, source, options) {
84
136
  /* eslint no-param-reassign: 0 */
85
137
  if (!source) {
@@ -89,7 +141,7 @@ var merge = function merge(target, source, options) {
89
141
  if (typeof source !== 'object' && typeof source !== 'function') {
90
142
  if (isArray(target)) {
91
143
  var nextIndex = target.length;
92
- if (options && typeof options.arrayLimit === 'number' && nextIndex >= options.arrayLimit) {
144
+ if (options && typeof options.arrayLimit === 'number' && countElements(target) >= options.arrayLimit) {
93
145
  if (options.throwOnLimitExceeded) {
94
146
  throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
95
147
  }
@@ -102,8 +154,20 @@ var merge = function merge(target, source, options) {
102
154
  var newIndex = getMaxIndex(target) + 1;
103
155
  target[newIndex] = source;
104
156
  setMaxIndex(target, newIndex);
157
+ } else if (options && options.strictMerge && isConflict(target)) {
158
+ var nextConflict = getConflictIndex(target) + 1;
159
+ if (
160
+ options.throwOnLimitExceeded
161
+ && typeof options.arrayLimit === 'number'
162
+ && nextConflict >= options.arrayLimit
163
+ ) {
164
+ throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
165
+ }
166
+ target[nextConflict] = source;
167
+ markConflict(target, nextConflict);
105
168
  } else if (options && options.strictMerge) {
106
- return [target, source];
169
+ var conflict = limitedPair(target, source, options);
170
+ return isArray(conflict) ? markConflict(conflict, 1) : conflict;
107
171
  } else if (
108
172
  (options && (options.plainObjects || options.allowPrototypes))
109
173
  || !has.call(Object.prototype, source)
@@ -111,7 +175,7 @@ var merge = function merge(target, source, options) {
111
175
  target[source] = true;
112
176
  }
113
177
  } else {
114
- return [target, source];
178
+ return limitedPair(target, source, options);
115
179
  }
116
180
 
117
181
  return target;
@@ -143,6 +207,10 @@ var merge = function merge(target, source, options) {
143
207
  var mergeTarget = target;
144
208
  if (isArray(target) && !isArray(source)) {
145
209
  mergeTarget = arrayToObject(target, options);
210
+ if (isConflict(target)) {
211
+ // the array may have grown past its last conflict, so continue after its last index
212
+ markConflict(mergeTarget, target.length - 1);
213
+ }
146
214
  }
147
215
 
148
216
  if (isArray(target) && isArray(source)) {
@@ -158,7 +226,7 @@ var merge = function merge(target, source, options) {
158
226
  target[i] = item;
159
227
  }
160
228
  });
161
- if (options && typeof options.arrayLimit === 'number' && target.length > options.arrayLimit) {
229
+ if (options && typeof options.arrayLimit === 'number' && countElements(target) > options.arrayLimit) {
162
230
  if (options.throwOnLimitExceeded) {
163
231
  throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
164
232
  }
@@ -177,7 +245,7 @@ var merge = function merge(target, source, options) {
177
245
  }
178
246
 
179
247
  if (isOverflow(source) && !isOverflow(acc)) {
180
- markOverflow(acc, getMaxIndex(source));
248
+ markOverflow(acc, maxNumericIndex(acc, getMaxIndex(source)));
181
249
  }
182
250
  if (isOverflow(acc)) {
183
251
  var keyNum = parseInt(key, 10);
@@ -185,6 +253,12 @@ var merge = function merge(target, source, options) {
185
253
  setMaxIndex(acc, keyNum);
186
254
  }
187
255
  }
256
+ if (isConflict(acc)) {
257
+ var conflictKey = parseInt(key, 10);
258
+ if (String(conflictKey) === key && conflictKey > getConflictIndex(acc)) {
259
+ markConflict(acc, conflictKey);
260
+ }
261
+ }
188
262
 
189
263
  return acc;
190
264
  }, mergeTarget);
@@ -198,6 +272,13 @@ var assign = function assignSingleSource(target, source) {
198
272
  };
199
273
 
200
274
  var decode = function (str, defaultDecoder, charset) {
275
+ // With no `%` there is no escape to expand, in either charset: `unescape` has
276
+ // nothing to match, and `decodeURIComponent` is the identity on such a string
277
+ // (and cannot throw). So only `+` -> ' ' remains, and often not even that.
278
+ if (typeof str === 'string' && str.indexOf('%') === -1) {
279
+ return str.indexOf('+') === -1 ? str : str.replace(/\+/g, ' ');
280
+ }
281
+
201
282
  var strWithoutPlus = str.replace(/\+/g, ' ');
202
283
  if (charset === 'iso-8859-1') {
203
284
  // unescape never throws, no try...catch needed:
@@ -211,6 +292,57 @@ var decode = function (str, defaultDecoder, charset) {
211
292
  }
212
293
  };
213
294
 
295
+ var hasToPrimitive = typeof Symbol === 'function' && typeof Symbol.toPrimitive === 'symbol';
296
+ var arrayJoin = Array.prototype.join;
297
+ var arrayToString = Array.prototype.toString;
298
+ var objectToString = Object.prototype.toString;
299
+
300
+ // an object with no callable toString (eg, from JSON, or null-prototype) would make String() or join() throw,
301
+ // so it becomes its primitive valueOf or else Object.prototype.toString; arrays are walked like join walks them,
302
+ // copied only once an element changes, with an array already being joined becoming '' as engines do for cycles
303
+ var toCoercible = function toCoercible(value, joining) {
304
+ if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
305
+ return value;
306
+ }
307
+ if (hasToPrimitive && value[Symbol.toPrimitive] != null) {
308
+ return value;
309
+ }
310
+ if (isArray(value) && value.toString === arrayToString && value.join === arrayJoin) {
311
+ var ancestors = joining || getSideChannel();
312
+ if (ancestors.has(value)) {
313
+ return '';
314
+ }
315
+ ancestors.set(value, true);
316
+ var copy;
317
+ for (var i = 0; i < value.length; i += 1) {
318
+ var item = value[i];
319
+ var coerced = toCoercible(item, ancestors);
320
+ if (!copy && coerced !== item) {
321
+ copy = [];
322
+ for (var j = 0; j < i; j += 1) {
323
+ copy[j] = value[j];
324
+ }
325
+ }
326
+ if (copy) {
327
+ copy[i] = coerced;
328
+ }
329
+ }
330
+ ancestors['delete'](value);
331
+ return copy || value;
332
+ }
333
+ if (typeof value.toString === 'function') {
334
+ return value;
335
+ }
336
+ var valueOf = value.valueOf;
337
+ if (typeof valueOf === 'function') {
338
+ var primitive = valueOf.call(value);
339
+ if (!primitive || (typeof primitive !== 'object' && typeof primitive !== 'function')) {
340
+ return String(primitive);
341
+ }
342
+ }
343
+ return objectToString.call(value);
344
+ };
345
+
214
346
  var limit = 1024;
215
347
 
216
348
  /* eslint operator-linebreak: [2, "before"] */
@@ -226,13 +358,15 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
226
358
  if (typeof str === 'symbol') {
227
359
  string = Symbol.prototype.toString.call(str);
228
360
  } else if (typeof str !== 'string') {
229
- string = String(str);
361
+ string = String(toCoercible(str));
230
362
  }
231
363
 
232
364
  if (charset === 'iso-8859-1') {
365
+ // `escape` leaves `+` untouched, but a literal `+` is decoded back to a space,
366
+ // so it must be percent-encoded to round-trip (the utf-8 path already does this).
233
367
  return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
234
368
  return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
235
- });
369
+ }).replace(/\+/g, '%2B');
236
370
  }
237
371
 
238
372
  var out = '';
@@ -253,11 +387,12 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
253
387
  c === 0x2D // -
254
388
  || c === 0x2E // .
255
389
  || c === 0x5F // _
256
- || c === 0x7E // ~
390
+ || (c === 0x7E && format !== formats.WHATWG) // ~
257
391
  || (c >= 0x30 && c <= 0x39) // 0-9
258
392
  || (c >= 0x41 && c <= 0x5A) // a-z
259
393
  || (c >= 0x61 && c <= 0x7A) // A-Z
260
394
  || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
395
+ || (format === formats.WHATWG && c === 0x2A) // *
261
396
  ) {
262
397
  arr[arr.length] = segment.charAt(i);
263
398
  continue;
@@ -281,13 +416,19 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
281
416
  continue;
282
417
  }
283
418
 
284
- i += 1;
285
- c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));
419
+ var next = segment.charCodeAt(i + 1);
420
+ if (c <= 0xDBFF && next >= 0xDC00 && next <= 0xDFFF) {
421
+ i += 1;
422
+ c = 0x10000 + (((c & 0x3FF) << 10) | (next & 0x3FF));
286
423
 
287
- arr[arr.length] = hexTable[0xF0 | (c >> 18)]
288
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
289
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
290
- + hexTable[0x80 | (c & 0x3F)];
424
+ arr[arr.length] = hexTable[0xF0 | (c >> 18)]
425
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
426
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
427
+ + hexTable[0x80 | (c & 0x3F)];
428
+ } else {
429
+ // a lone surrogate has no UTF-8 encoding; like `URLSearchParams` and `TextEncoder`, emit U+FFFD
430
+ arr[arr.length] = '%EF%BF%BD';
431
+ }
291
432
  }
292
433
 
293
434
  out += arr.join('');
@@ -384,5 +525,7 @@ module.exports = {
384
525
  isRegExp: isRegExp,
385
526
  markOverflow: markOverflow,
386
527
  maybeMap: maybeMap,
387
- merge: merge
528
+ merge: merge,
529
+ setProperty: setProperty,
530
+ toCoercible: toCoercible
388
531
  };
@@ -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.16.0",
5
+ "version": "6.17.1",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/ljharb/qs.git"
@@ -37,14 +37,14 @@
37
37
  "devDependencies": {
38
38
  "@browserify/envify": "^6.0.0",
39
39
  "@browserify/uglifyify": "^6.0.0",
40
- "@ljharb/eslint-config": "^22.2.4",
40
+ "@ljharb/eslint-config": "^22.2.5",
41
41
  "browserify": "^16.5.2",
42
42
  "bundle-collapser": "^1.4.0",
43
43
  "common-shakeify": "~1.0.0",
44
44
  "eclint": "^2.8.1",
45
45
  "es-value-fixtures": "^1.7.1",
46
- "eslint": "^10.9.0",
47
- "evalmd": "^0.0.22",
46
+ "eslint": "^10.13.0",
47
+ "evalmd": "^0.1.0",
48
48
  "for-each": "^0.3.5",
49
49
  "glob": "=10.3.7",
50
50
  "has-bigints": "^1.1.0",
@@ -59,25 +59,25 @@
59
59
  "mkdirp": "^0.5.5",
60
60
  "mock-property": "^1.1.2",
61
61
  "module-deps": "^6.2.3",
62
- "npmignore": "^0.3.5",
62
+ "npmignore": "^0.3.6",
63
63
  "nyc": "^10.3.2",
64
64
  "object-inspect": "^1.13.4",
65
65
  "qs-iconv": "^1.0.4",
66
66
  "safe-publish-latest": "^2.0.0",
67
67
  "safer-buffer": "^2.1.2",
68
- "tape": "^5.10.2",
68
+ "tape": "^5.10.3",
69
69
  "unassertify": "^3.0.1"
70
70
  },
71
71
  "scripts": {
72
72
  "prepack": "npmignore --auto --commentLines=autogenerated && npm run dist",
73
73
  "prepublishOnly": "safe-publish-latest",
74
74
  "prepublish": "not-in-publish || npm run prepublishOnly",
75
- "pretest": "npm run --silent readme && npm run --silent lint",
75
+ "pretest": "npm run lint",
76
76
  "test": "npm run tests-only",
77
77
  "tests-only": "nyc tape 'test/**/*.js'",
78
78
  "posttest": "npx npm@'>=10.2' audit --production",
79
- "readme": "evalmd README.md",
80
79
  "postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)",
80
+ "prelint": "evalmd --eslint README.md",
81
81
  "lint": "eslint .",
82
82
  "dist": "mkdirp dist && browserify --standalone Qs -g unassertify -g @browserify/envify -g [@browserify/uglifyify --mangle.keep_fnames --compress.keep_fnames --format.indent_level=1 --compress.arrows=false --compress.passes=4 --compress.typeofs=false] -p common-shakeify -p bundle-collapser/plugin lib/index.js > dist/qs.js"
83
83
  },