Skip to content

Commit ea4661a

Browse files
authored
fix(typing): Allows all busboy options on plugin registration (#536)
* fix(typing): options like `preservePath` are not known * fix(typing): extends FastifyMultipartBaseOptions * fix(testing): add tsd test
1 parent b7534c7 commit ea4661a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ declare namespace fastifyMultipart {
104104
[fieldname: string]: Multipart | Multipart[] | undefined;
105105
}
106106

107-
export interface FastifyMultipartBaseOptions {
107+
export interface FastifyMultipartBaseOptions extends Partial<BusboyConfig> {
108108
/**
109109
* Add a shared schema to validate the input fields
110110
*/

types/index.test-d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const runServer = async () => {
1414
const app = fastify()
1515

1616
app.register(fastifyMultipart, {
17+
preservePath: true, // field inherited from `BusboyConfig` interface
1718
attachFieldsToBody: true,
1819
limits: {
1920
parts: 500

0 commit comments

Comments
 (0)