fastify 5.11.3 → 5.12.1

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 (47) hide show
  1. package/.pi/self-learning-memory/README.md +8 -0
  2. package/.pi/self-learning-memory/core/CORE.md +33 -0
  3. package/.pi/self-learning-memory/core/index.json +735 -0
  4. package/.pi/self-learning-memory/daily/2026-07-06.md +22 -0
  5. package/.pi/self-learning-memory/daily/2026-07-29.md +50 -0
  6. package/.pi/self-learning-memory/daily/2026-08-04.md +41 -0
  7. package/.pi/self-learning-memory/daily/2026-08-18.md +40 -0
  8. package/.pi/self-learning-memory/long-term-memory.md +89 -0
  9. package/AGENTS.md +290 -0
  10. package/SPONSORS.md +1 -0
  11. package/docs/Guides/Serverless.md +34 -2
  12. package/docs/Reference/Reply.md +14 -0
  13. package/docs/Reference/Server.md +8 -3
  14. package/fastify.d.ts +1 -1
  15. package/fastify.js +2 -2
  16. package/lib/content-type.js +4 -1
  17. package/lib/reply.js +11 -1
  18. package/lib/request.js +3 -2
  19. package/lib/route.js +2 -1
  20. package/lib/validation.js +10 -1
  21. package/package.json +2 -3
  22. package/test/close.test.js +34 -0
  23. package/test/content-parser.test.js +16 -18
  24. package/test/content-type.test.js +4 -0
  25. package/test/fix-root-primitive-coercion.test.js +35 -0
  26. package/test/helper.js +73 -1
  27. package/test/hooks-async.test.js +1 -2
  28. package/test/hooks.test.js +1 -2
  29. package/test/internals/reply.test.js +76 -1
  30. package/test/listen.1.test.js +17 -52
  31. package/test/listen.5.test.js +6 -9
  32. package/test/logger/instantiation.test.js +1 -1
  33. package/test/logger/logging.test.js +1 -1
  34. package/test/logger/request.test.js +1 -1
  35. package/test/logger/response.test.js +1 -1
  36. package/test/plugin.4.test.js +5 -4
  37. package/test/reply-media-type.test.js +131 -0
  38. package/test/route-prefix.test.js +33 -1
  39. package/test/route.6.test.js +4 -11
  40. package/test/schema-feature.test.js +36 -65
  41. package/test/schema-serialization.test.js +1 -1
  42. package/test/schema-special-usage.test.js +1 -1
  43. package/test/schema-validation.test.js +1 -1
  44. package/test/stream.2.test.js +1 -1
  45. package/test/trust-proxy.test.js +27 -21
  46. package/test/types/fastify.tst.ts +2 -0
  47. package/test/toolkit.js +0 -63
package/test/toolkit.js DELETED
@@ -1,63 +0,0 @@
1
- 'use strict'
2
-
3
- exports.waitForCb = function (options) {
4
- let count = null
5
- let done = false
6
- let iResolve
7
- let iReject
8
-
9
- function stepIn () {
10
- if (done) {
11
- iReject(new Error('Unexpected done call'))
12
- return
13
- }
14
-
15
- if (--count) {
16
- return
17
- }
18
-
19
- done = true
20
- iResolve()
21
- }
22
-
23
- const patience = new Promise((resolve, reject) => {
24
- iResolve = resolve
25
- iReject = reject
26
- })
27
-
28
- count = options.steps || 1
29
- done = false
30
-
31
- return { stepIn, patience }
32
- }
33
-
34
- exports.partialDeepStrictEqual = function partialDeepStrictEqual (actual, expected) {
35
- if (typeof expected !== 'object' || expected === null) {
36
- return actual === expected
37
- }
38
-
39
- if (typeof actual !== 'object' || actual === null) {
40
- return false
41
- }
42
-
43
- if (Array.isArray(expected)) {
44
- if (!Array.isArray(actual)) return false
45
- if (expected.length > actual.length) return false
46
-
47
- for (let i = 0; i < expected.length; i++) {
48
- if (!partialDeepStrictEqual(actual[i], expected[i])) {
49
- return false
50
- }
51
- }
52
- return true
53
- }
54
-
55
- for (const key of Object.keys(expected)) {
56
- if (!(key in actual)) return false
57
- if (!partialDeepStrictEqual(actual[key], expected[key])) {
58
- return false
59
- }
60
- }
61
-
62
- return true
63
- }