Skip to content

Commit

Permalink
fix(typing): Allows all busboy options on plugin registration (#536)
Browse files Browse the repository at this point in the history
* fix(typing): options like `preservePath` are not known

* fix(typing): extends FastifyMultipartBaseOptions

* fix(testing): add tsd test
  • Loading branch information
johaven committed Jul 29, 2024
1 parent b7534c7 commit ea4661a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ declare namespace fastifyMultipart {
[fieldname: string]: Multipart | Multipart[] | undefined;
}

export interface FastifyMultipartBaseOptions {
export interface FastifyMultipartBaseOptions extends Partial<BusboyConfig> {
/**
* Add a shared schema to validate the input fields
*/
Expand Down
1 change: 1 addition & 0 deletions types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const runServer = async () => {
const app = fastify()

app.register(fastifyMultipart, {
preservePath: true, // field inherited from `BusboyConfig` interface
attachFieldsToBody: true,
limits: {
parts: 500
Expand Down

0 comments on commit ea4661a

Please sign in to comment.