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.
- package/.pi/self-learning-memory/README.md +8 -0
- package/.pi/self-learning-memory/core/CORE.md +33 -0
- package/.pi/self-learning-memory/core/index.json +735 -0
- package/.pi/self-learning-memory/daily/2026-07-06.md +22 -0
- package/.pi/self-learning-memory/daily/2026-07-29.md +50 -0
- package/.pi/self-learning-memory/daily/2026-08-04.md +41 -0
- package/.pi/self-learning-memory/daily/2026-08-18.md +40 -0
- package/.pi/self-learning-memory/long-term-memory.md +89 -0
- package/AGENTS.md +290 -0
- package/SPONSORS.md +1 -0
- package/docs/Guides/Serverless.md +34 -2
- package/docs/Reference/Reply.md +14 -0
- package/docs/Reference/Server.md +8 -3
- package/fastify.d.ts +1 -1
- package/fastify.js +2 -2
- package/lib/content-type.js +4 -1
- package/lib/reply.js +11 -1
- package/lib/request.js +3 -2
- package/lib/route.js +2 -1
- package/lib/validation.js +10 -1
- package/package.json +2 -3
- package/test/close.test.js +34 -0
- package/test/content-parser.test.js +16 -18
- package/test/content-type.test.js +4 -0
- package/test/fix-root-primitive-coercion.test.js +35 -0
- package/test/helper.js +73 -1
- package/test/hooks-async.test.js +1 -2
- package/test/hooks.test.js +1 -2
- package/test/internals/reply.test.js +76 -1
- package/test/listen.1.test.js +17 -52
- package/test/listen.5.test.js +6 -9
- package/test/logger/instantiation.test.js +1 -1
- package/test/logger/logging.test.js +1 -1
- package/test/logger/request.test.js +1 -1
- package/test/logger/response.test.js +1 -1
- package/test/plugin.4.test.js +5 -4
- package/test/reply-media-type.test.js +131 -0
- package/test/route-prefix.test.js +33 -1
- package/test/route.6.test.js +4 -11
- package/test/schema-feature.test.js +36 -65
- package/test/schema-serialization.test.js +1 -1
- package/test/schema-special-usage.test.js +1 -1
- package/test/schema-validation.test.js +1 -1
- package/test/stream.2.test.js +1 -1
- package/test/trust-proxy.test.js +27 -21
- package/test/types/fastify.tst.ts +2 -0
- 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
|
-
}
|