@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
@@ -106,6 +106,146 @@ test('merge()', function (t) {
106
106
  s2t.end();
107
107
  });
108
108
 
109
+ st.test('with strictMerge, repeated conflicts append instead of nesting a new wrapper', function (s2t) {
110
+ var opts = { strictMerge: true };
111
+ var wrapped = utils.merge({ foo: 'bar' }, 'baz', opts);
112
+ s2t.deepEqual(wrapped, [{ foo: 'bar' }, 'baz'], 'first conflict wraps in an array');
113
+
114
+ var withObject = utils.merge(wrapped, { qux: 'quux' }, opts);
115
+ s2t.deepEqual(
116
+ withObject,
117
+ { 0: { foo: 'bar' }, 1: 'baz', qux: 'quux' },
118
+ 'merging an object converts the wrapper to an object'
119
+ );
120
+
121
+ var second = utils.merge(withObject, 'corge', opts);
122
+ s2t.deepEqual(
123
+ second,
124
+ { 0: { foo: 'bar' }, 1: 'baz', 2: 'corge', qux: 'quux' },
125
+ 'a second conflict appends at the next index'
126
+ );
127
+
128
+ var third = utils.merge(second, 'grault', opts);
129
+ s2t.deepEqual(
130
+ third,
131
+ { 0: { foo: 'bar' }, 1: 'baz', 2: 'corge', 3: 'grault', qux: 'quux' },
132
+ 'a third conflict appends again, so nesting depth stays constant'
133
+ );
134
+
135
+ s2t.end();
136
+ });
137
+
138
+ st.test('with strictMerge, a caller-supplied array is still wrapped, not appended to', function (s2t) {
139
+ var merged = utils.merge({ 0: 'a', 1: 'b' }, 'c', { strictMerge: true });
140
+ s2t.deepEqual(merged, [{ 0: 'a', 1: 'b' }, 'c'], 'an unmarked object with numeric keys is wrapped');
141
+ s2t.end();
142
+ });
143
+
144
+ st.test('with strictMerge, throws instead of appending a conflict past arrayLimit with throwOnLimitExceeded', function (s2t) {
145
+ var appendConflict = function (options) {
146
+ var wrapped = utils.merge({ foo: 'bar' }, 'baz', { strictMerge: true });
147
+ var container = utils.merge(wrapped, { qux: 'quux' }, { strictMerge: true });
148
+ return utils.merge(container, 'corge', options);
149
+ };
150
+
151
+ s2t['throws'](
152
+ function () { appendConflict({ strictMerge: true, arrayLimit: 1, throwOnLimitExceeded: true }); },
153
+ new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
154
+ 'appending to a two-element container past arrayLimit throws'
155
+ );
156
+ s2t['throws'](
157
+ function () { appendConflict({ strictMerge: true, arrayLimit: 2, throwOnLimitExceeded: true }); },
158
+ new RangeError('Array limit exceeded. Only 2 elements allowed in an array.'),
159
+ 'uses the plural message when arrayLimit is not 1'
160
+ );
161
+ s2t.deepEqual(
162
+ appendConflict({ strictMerge: true, arrayLimit: 3, throwOnLimitExceeded: true }),
163
+ { 0: { foo: 'bar' }, 1: 'baz', 2: 'corge', qux: 'quux' },
164
+ 'appends while the container stays within arrayLimit'
165
+ );
166
+ s2t.deepEqual(
167
+ appendConflict({ strictMerge: true, arrayLimit: 1 }),
168
+ { 0: { foo: 'bar' }, 1: 'baz', 2: 'corge', qux: 'quux' },
169
+ 'still appends past arrayLimit without throwOnLimitExceeded, since the container is already an object'
170
+ );
171
+
172
+ s2t.end();
173
+ });
174
+
175
+ st.test('with strictMerge, a conflict appends after numeric keys already in its container', function (s2t) {
176
+ var opts = { strictMerge: true };
177
+
178
+ var container = utils.merge(utils.merge({ foo: 'bar' }, 'baz', opts), { qux: 'quux' }, opts);
179
+ var withIndex = utils.merge(container, { 2: 'keep' }, opts);
180
+ s2t.deepEqual(
181
+ utils.merge(withIndex, 'corge', opts),
182
+ { 0: { foo: 'bar' }, 1: 'baz', 2: 'keep', 3: 'corge', qux: 'quux' },
183
+ 'a numeric key merged into the container is not overwritten'
184
+ );
185
+
186
+ var sparse = [];
187
+ sparse[2] = 'keep';
188
+ var extended = utils.merge(utils.merge({ foo: 'bar' }, 'baz', opts), sparse, opts);
189
+ s2t.deepEqual(extended, [{ foo: 'bar' }, 'baz', 'keep'], 'an indexed value extends the container while it is an array');
190
+ var converted = utils.merge(extended, { qux: 'quux' }, opts);
191
+ s2t.deepEqual(
192
+ utils.merge(converted, 'corge', opts),
193
+ { 0: { foo: 'bar' }, 1: 'baz', 2: 'keep', 3: 'corge', qux: 'quux' },
194
+ 'converting the container to an object keeps its last index'
195
+ );
196
+
197
+ s2t.end();
198
+ });
199
+
200
+ st.test('enforces arrayLimit on the two-element array built for colliding values', function (s2t) {
201
+ s2t['throws'](
202
+ function () { utils.merge({ foo: 'bar' }, 'baz', { strictMerge: true, arrayLimit: 1, throwOnLimitExceeded: true }); },
203
+ new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
204
+ 'a strictMerge conflict throws at arrayLimit 1'
205
+ );
206
+ s2t['throws'](
207
+ function () { utils.merge('a', 'b', { arrayLimit: 0, throwOnLimitExceeded: true }); },
208
+ new RangeError('Array limit exceeded. Only 0 elements allowed in an array.'),
209
+ 'two colliding primitives throw at arrayLimit 0'
210
+ );
211
+
212
+ var conflict = utils.merge({ foo: 'bar' }, 'baz', { strictMerge: true, arrayLimit: 1 });
213
+ s2t.ok(utils.isOverflow(conflict), 'without throwOnLimitExceeded, a strictMerge conflict converts to an overflow object');
214
+ s2t.deepEqual(conflict, { 0: { foo: 'bar' }, 1: 'baz' }, 'holding both values');
215
+
216
+ var pair = utils.merge('a', 'b', { arrayLimit: 1 });
217
+ s2t.ok(utils.isOverflow(pair), 'without throwOnLimitExceeded, two colliding primitives convert to an overflow object');
218
+ s2t.deepEqual(pair, { 0: 'a', 1: 'b' }, 'holding both values');
219
+
220
+ s2t.deepEqual(
221
+ utils.merge({ foo: 'bar' }, 'baz', { strictMerge: true, arrayLimit: 2, throwOnLimitExceeded: true }),
222
+ [{ foo: 'bar' }, 'baz'],
223
+ 'a strictMerge conflict within arrayLimit is still an array'
224
+ );
225
+ s2t.deepEqual(
226
+ utils.merge('a', 'b', { arrayLimit: 2, throwOnLimitExceeded: true }),
227
+ ['a', 'b'],
228
+ 'two colliding primitives within arrayLimit are still an array'
229
+ );
230
+
231
+ s2t.end();
232
+ });
233
+
234
+ st.test('seeds an overflow container index from the keys it already holds', function (s2t) {
235
+ var overflow = utils.combine(['a'], 'b', 0, false);
236
+ s2t.ok(utils.isOverflow(overflow), 'the source is an overflow object');
237
+
238
+ var merged = utils.merge({ 2: 'keep', z: 'zz' }, overflow);
239
+ s2t.ok(utils.isOverflow(merged), 'the result is marked as overflow');
240
+ s2t.deepEqual(
241
+ utils.merge(merged, 'c'),
242
+ { 0: 'a', 1: 'b', 2: 'keep', 3: 'c', z: 'zz' },
243
+ 'the next value lands after the highest numeric key the container already held'
244
+ );
245
+
246
+ s2t.end();
247
+ });
248
+
109
249
  st.test('merges overflow object into primitive', function (s2t) {
110
250
  // Create an overflow object via combine: 2 elements (indices 0-1) with limit 0
111
251
  var overflow = utils.combine(['a'], 'b', 0, false);
@@ -441,6 +581,50 @@ test('decode', function (t) {
441
581
  'decodes a string in iso-8859-1'
442
582
  );
443
583
 
584
+ t.test('strings with no percent sign', function (st) {
585
+ st.equal(utils.decode(''), '', 'empty string');
586
+ st.equal(utils.decode('abc'), 'abc', 'returns a plain string unchanged');
587
+ st.equal(utils.decode('abc', null, 'iso-8859-1'), 'abc', 'returns a plain string unchanged in iso-8859-1');
588
+ st.equal(utils.decode('a++b+'), 'a b ', 'decodes every + to a space');
589
+ st.equal(utils.decode('a++b+', null, 'iso-8859-1'), 'a b ', 'decodes every + to a space in iso-8859-1');
590
+ st.equal(utils.decode('\uD800x\uDC00'), '\uD800x\uDC00', 'leaves lone surrogates unchanged');
591
+ st.equal(utils.decode('😀+'), '😀 ', 'leaves surrogate pairs unchanged');
592
+ st.equal(utils.decode('a=b&c'), 'a=b&c', 'leaves delimiters unchanged');
593
+
594
+ st.end();
595
+ });
596
+
597
+ t.test('strings with a percent sign', function (st) {
598
+ st.equal(utils.decode('a+%20b'), 'a b', 'decodes both + and an escape');
599
+ st.equal(utils.decode('%E9+x', null, 'iso-8859-1'), 'é x', 'decodes both + and an escape in iso-8859-1');
600
+ st.equal(utils.decode('a+%'), 'a %', 'decodes + even when the escape is malformed');
601
+ st.equal(utils.decode('a+%E0%A4%A'), 'a %E0%A4%A', 'decodes + even when the escape is truncated');
602
+
603
+ st.end();
604
+ });
605
+
606
+ t.test('non-strings', function (st) {
607
+ forEach(v.nullPrimitives, function (nullish) {
608
+ st['throws'](
609
+ function () { utils.decode(nullish); },
610
+ TypeError,
611
+ inspect(nullish) + ' is not a string'
612
+ );
613
+ });
614
+ st['throws'](
615
+ function () { utils.decode(['a']); },
616
+ TypeError,
617
+ 'an array is not a string'
618
+ );
619
+
620
+ /* eslint no-new-wrappers: 0 */
621
+ st.equal(utils.decode(new String('ab')), 'ab', 'a boxed string decodes to a primitive');
622
+ st.equal(utils.decode(new String('a+b')), 'a b', 'a boxed string with + decodes to a primitive');
623
+ st.equal(utils.decode(new String('a%20b')), 'a b', 'a boxed string with an escape decodes to a primitive');
624
+
625
+ st.end();
626
+ });
627
+
444
628
  t.end();
445
629
  });
446
630
 
@@ -558,7 +742,7 @@ test('encode', function (t) {
558
742
  loneExpected += 'a';
559
743
  }
560
744
  loneBoundary += '\uD83DX';
561
- loneExpected += '%F0%9F%91%98';
745
+ loneExpected += '%EF%BF%BDX';
562
746
 
563
747
  t.equal(
564
748
  utils.encode(loneBoundary),
@@ -566,6 +750,17 @@ test('encode', function (t) {
566
750
  'a lone high surrogate at a chunk boundary encodes the same as mid-chunk'
567
751
  );
568
752
 
753
+ t.equal(
754
+ utils.encode(loneBoundary.slice(0, 1023) + '\uDC00X'),
755
+ loneExpected.slice(0, 1023) + '%EF%BF%BDX',
756
+ 'a lone low surrogate at a chunk boundary does not consume the next character'
757
+ );
758
+ t.equal(
759
+ utils.encode(loneBoundary.slice(0, 1024)),
760
+ loneExpected.slice(0, 1023) + '%EF%BF%BD',
761
+ 'a lone high surrogate ending a string of exactly one chunk encodes as U+FFFD'
762
+ );
763
+
569
764
  t.equal(
570
765
  utils.encode('\x28\x29'),
571
766
  '%28%29',
@@ -577,8 +772,30 @@ test('encode', function (t) {
577
772
  'does not encode parens in RFC1738'
578
773
  );
579
774
 
775
+ t.equal(
776
+ utils.encode('~*()'),
777
+ '~%2A%28%29',
778
+ 'leaves `~` unencoded, and encodes `*` and parens, by default'
779
+ );
780
+ t.equal(
781
+ utils.encode('~*()', null, null, null, 'RFC3986'),
782
+ '~%2A%28%29',
783
+ 'leaves `~` unencoded, and encodes `*` and parens, in RFC3986'
784
+ );
785
+ t.equal(
786
+ utils.encode('~*() ', null, null, null, 'RFC1738'),
787
+ '~%2A()%20',
788
+ 'leaves `~` and parens unencoded, and encodes `*` and spaces, in RFC1738'
789
+ );
790
+
580
791
  // todo RFC1738 format
581
792
 
793
+ t.equal(
794
+ utils.encode('~*()', null, null, null, 'WHATWG'),
795
+ '%7E*%28%29',
796
+ 'encodes `~` and parens, but not `*`, in WHATWG'
797
+ );
798
+
582
799
  t.equal(
583
800
  utils.encode('Āက豈'),
584
801
  '%C4%80%E1%80%80%EF%A4%80',
@@ -587,8 +804,33 @@ test('encode', function (t) {
587
804
 
588
805
  t.equal(
589
806
  utils.encode('\uD83D \uDCA9'),
590
- '%F0%9F%90%A0%F0%BA%90%80',
591
- 'encodes lone surrogates'
807
+ '%EF%BF%BD%20%EF%BF%BD',
808
+ 'encodes lone surrogates as U+FFFD, without consuming the next character'
809
+ );
810
+ t.equal(
811
+ utils.encode('\uDCA9\uD83D'),
812
+ '%EF%BF%BD%EF%BF%BD',
813
+ 'encodes a reversed surrogate pair as two U+FFFD'
814
+ );
815
+ t.equal(
816
+ utils.encode('x\uD83D'),
817
+ 'x%EF%BF%BD',
818
+ 'encodes a trailing lone high surrogate as U+FFFD'
819
+ );
820
+ t.equal(
821
+ utils.encode('\uD83D\uD83D\uDCA9'),
822
+ '%EF%BF%BD%F0%9F%92%A9',
823
+ 'a lone high surrogate does not prevent the following pair from encoding'
824
+ );
825
+ t.equal(
826
+ utils.encode('\uD83D\uE000'),
827
+ '%EF%BF%BD%EE%80%80',
828
+ 'a high surrogate followed by a code unit above the low surrogate range is not combined'
829
+ );
830
+ t.equal(
831
+ utils.encode('\uDC00\uDC00'),
832
+ '%EF%BF%BD%EF%BF%BD',
833
+ 'a low surrogate followed by a low surrogate is not combined'
592
834
  );
593
835
 
594
836
  t.end();
@@ -1,11 +1,26 @@
1
- 2.2.0 / 2025-03-26
2
- ==================
1
+ 2.3.0
2
+ =====
3
+
4
+ * Add `router.listRoutes()` to list the registered routes
5
+ * Add `diagnostics_channel` tracing through the `express.router.request` `TracingChannel`
6
+ - Traces request handlers, error handlers and `router.param()` callbacks
7
+ - Exposes the matched route pattern as `route` on the tracing context
8
+ * Add TypeScript declarations for `Router` and `Route`
9
+ * perf: skip decoding route parameters without `%`
10
+ * Set `err.statusCode` to 400 for malformed route parameters
11
+ * Fix `req.url` losing the path separator when a mounted layer rewrites it
12
+ * Keep layer match results local to each request
13
+ - The internal `Layer` no longer stores `keys`, `params` or `path`
14
+ - The internal `layer.match()` returns `{ params, path, keys, pattern }` or `false` instead of a boolean
15
+
16
+ 2.2.0
17
+ =====
3
18
 
4
19
  * Remove `setImmediate` support check
5
20
  * Restore `debug` dependency
6
21
 
7
- 2.1.0 / 2025-02-10
8
- ==================
22
+ 2.1.0
23
+ =====
9
24
 
10
25
  * Updated `engines` field to Node@18 or higher
11
26
  * Remove `Object.setPrototypeOf` polyfill
@@ -16,8 +31,8 @@
16
31
  * Replace `utils-merge` dependency with `Object.assign`
17
32
  * deps: Remove unused dep `after`
18
33
 
19
- 2.0.0 / 2024-09-09
20
- ==================
34
+ 2.0.0
35
+ =====
21
36
 
22
37
  * Drop support for node <18
23
38
  * deps: path-to-regexp@^8.0.0
@@ -29,15 +44,15 @@
29
44
  - `:name+` becomes `*name` and thus equivalent to `*name` so I dropped those tests
30
45
  - Strings as regular expressions are fully removed, need to be converted to native regular expressions
31
46
 
32
- 2.0.0-beta.2 / 2024-03-20
33
- =========================
47
+ 2.0.0-beta.2
48
+ ============
34
49
 
35
50
  This incorporates all changes after 1.3.5 up to 1.3.8.
36
51
 
37
52
  * Add support for returned, rejected Promises to `router.param`
38
53
 
39
- 2.0.0-beta.1 / 2020-03-29
40
- =========================
54
+ 2.0.0-beta.1
55
+ ============
41
56
 
42
57
  This incorporates all changes after 1.3.3 up to 1.3.5.
43
58
 
@@ -60,8 +75,8 @@ This incorporates all changes after 1.3.3 up to 1.3.5.
60
75
  `/foo/*/bar` will match a literal `*` as the middle segment.
61
76
  * deps: setprototypeof@1.2.0
62
77
 
63
- 2.0.0-alpha.1 / 2018-07-27
64
- ==========================
78
+ 2.0.0-alpha.1
79
+ =============
65
80
 
66
81
  * Add basic support for returned, rejected Promises
67
82
  - Rejected Promises from middleware functions `next(error)`
@@ -73,42 +88,42 @@ This incorporates all changes after 1.3.3 up to 1.3.5.
73
88
  - Remove `DEBUG_FD` environment variable support
74
89
  - Support 256 namespace colors
75
90
 
76
- 1.3.8 / 2023-02-24
77
- ==================
91
+ 1.3.8
92
+ =====
78
93
 
79
94
  * Fix routing requests without method
80
95
 
81
- 1.3.7 / 2022-04-28
82
- ==================
96
+ 1.3.7
97
+ =====
83
98
 
84
99
  * Fix hanging on large stack of sync routes
85
100
 
86
- 1.3.6 / 2021-11-15
87
- ==================
101
+ 1.3.6
102
+ =====
88
103
 
89
104
  * Fix handling very large stacks of sync middleware
90
105
  * deps: safe-buffer@5.2.1
91
106
 
92
- 1.3.5 / 2020-03-24
93
- ==================
107
+ 1.3.5
108
+ =====
94
109
 
95
110
  * Fix incorrect middleware execution with unanchored `RegExp`s
96
111
  * perf: use plain object for internal method map
97
112
 
98
- 1.3.4 / 2020-01-24
99
- ==================
113
+ 1.3.4
114
+ =====
100
115
 
101
116
  * deps: array-flatten@3.0.0
102
117
  * deps: parseurl@~1.3.3
103
118
  * deps: setprototypeof@1.2.0
104
119
 
105
- 1.3.3 / 2018-07-06
106
- ==================
120
+ 1.3.3
121
+ =====
107
122
 
108
123
  * Fix JSDoc for `Router` constructor
109
124
 
110
- 1.3.2 / 2017-09-24
111
- ==================
125
+ 1.3.2
126
+ =====
112
127
 
113
128
  * deps: debug@2.6.9
114
129
  * deps: parseurl@~1.3.2
@@ -117,15 +132,15 @@ This incorporates all changes after 1.3.3 up to 1.3.5.
117
132
  * deps: setprototypeof@1.1.0
118
133
  * deps: utils-merge@1.0.1
119
134
 
120
- 1.3.1 / 2017-05-19
121
- ==================
135
+ 1.3.1
136
+ =====
122
137
 
123
138
  * deps: debug@2.6.8
124
139
  - Fix `DEBUG_MAX_ARRAY_LENGTH`
125
140
  - deps: ms@2.0.0
126
141
 
127
- 1.3.0 / 2017-02-25
128
- ==================
142
+ 1.3.0
143
+ =====
129
144
 
130
145
  * Add `next("router")` to exit from router
131
146
  * Fix case where `router.use` skipped requests routes did not
@@ -133,8 +148,8 @@ This incorporates all changes after 1.3.3 up to 1.3.5.
133
148
  * deps: setprototypeof@1.0.3
134
149
  * perf: add fast match path for `*` route
135
150
 
136
- 1.2.0 / 2017-02-17
137
- ==================
151
+ 1.2.0
152
+ =====
138
153
 
139
154
  * Skip routing when `req.url` is not set
140
155
  * deps: debug@2.6.1
@@ -144,15 +159,15 @@ This incorporates all changes after 1.3.3 up to 1.3.5.
144
159
  - Use same color for same namespace
145
160
  - deps: ms@0.7.2
146
161
 
147
- 1.1.5 / 2017-01-28
148
- ==================
162
+ 1.1.5
163
+ =====
149
164
 
150
165
  * deps: array-flatten@2.1.1
151
166
  * deps: setprototypeof@1.0.2
152
167
  - Fix using fallback even when native method exists
153
168
 
154
- 1.1.4 / 2016-01-21
155
- ==================
169
+ 1.1.4
170
+ =====
156
171
 
157
172
  * deps: array-flatten@2.0.0
158
173
  * deps: methods@~1.1.2
@@ -160,8 +175,8 @@ This incorporates all changes after 1.3.3 up to 1.3.5.
160
175
  * deps: parseurl@~1.3.1
161
176
  - perf: enable strict mode
162
177
 
163
- 1.1.3 / 2015-08-02
164
- ==================
178
+ 1.1.3
179
+ =====
165
180
 
166
181
  * Fix infinite loop condition using `mergeParams: true`
167
182
  * Fix inner numeric indices incorrectly altering parent `req.params`
@@ -170,8 +185,8 @@ This incorporates all changes after 1.3.3 up to 1.3.5.
170
185
  * deps: path-to-regexp@0.1.7
171
186
  - Fix regression with escaped round brackets and matching groups
172
187
 
173
- 1.1.2 / 2015-07-06
174
- ==================
188
+ 1.1.2
189
+ =====
175
190
 
176
191
  * Fix hiding platform issues with `decodeURIComponent`
177
192
  - Only `URIError`s are a 400
@@ -183,31 +198,31 @@ This incorporates all changes after 1.3.3 up to 1.3.5.
183
198
  * perf: skip attempting to decode zero length string
184
199
  * perf: use plain for loops
185
200
 
186
- 1.1.1 / 2015-05-25
187
- ==================
201
+ 1.1.1
202
+ =====
188
203
 
189
204
  * Fix issue where `next('route')` in `router.param` would incorrectly skip values
190
205
  * deps: array-flatten@1.1.0
191
206
  * deps: debug@~2.2.0
192
207
  - deps: ms@0.7.1
193
208
 
194
- 1.1.0 / 2015-04-22
195
- ==================
209
+ 1.1.0
210
+ =====
196
211
 
197
212
  * Use `setprototypeof` instead of `__proto__`
198
213
  * deps: debug@~2.1.3
199
214
  - Fix high intensity foreground color for bold
200
215
  - deps: ms@0.7.0
201
216
 
202
- 1.0.0 / 2015-01-13
203
- ==================
217
+ 1.0.0
218
+ =====
204
219
 
205
220
  * Fix crash from error within `OPTIONS` response handler
206
221
  * deps: array-flatten@1.0.2
207
222
  - Remove redundant code path
208
223
 
209
- 1.0.0-beta.3 / 2015-01-11
210
- =========================
224
+ 1.0.0-beta.3
225
+ ============
211
226
 
212
227
  * Fix duplicate methods appearing in OPTIONS responses
213
228
  * Fix OPTIONS responses to include the HEAD method properly
@@ -216,13 +231,13 @@ This incorporates all changes after 1.3.3 up to 1.3.5.
216
231
  * deps: debug@~2.1.1
217
232
  * deps: methods@~1.1.1
218
233
 
219
- 1.0.0-beta.2 / 2014-11-19
220
- =========================
234
+ 1.0.0-beta.2
235
+ ============
221
236
 
222
237
  * Match routes iteratively to prevent stack overflows
223
238
 
224
- 1.0.0-beta.1 / 2014-11-16
225
- =========================
239
+ 1.0.0-beta.1
240
+ ============
226
241
 
227
242
  * Initial release ported from Express 4.x
228
243
  - Altered to work without Express