hapijs / hapi

The Simple, Secure Framework Developers Trust

Home Page:https://hapi.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing maxParts type in route.d.ts

edoardo-bluframe opened this issue · comments

Runtime

node.js

Runtime version

18+

Module version

21.3.3

Last module version without issue

No response

Used with

No response

Any other relevant information

No response

What are you trying to achieve or the steps to reproduce?

Set maxParts in multipart payload

payload: {
      // 2MB
      maxBytes: 2097152,
      maxParts: 2,
      multipart: {
        output: "stream"
      },
      parse: true
    }

What was the result you got?

When we do that we get:

typescript: Object literal may only specify known properties, and 'maxParts' does not exist in type 'RouteOptionsPayload'. [2353]

What result did you expect?

We expect it to work:

This is actually a super easy fix:

maxBytes?: number | undefined;

We just need to add

maxParts?: number | undefined;

In that line 😄